/*
 * 파일명: style.css
 * 위치: /assets/css/
 * 기능: Classroom Timer 스타일시트 - 밝고 모던한 디자인
 * 작성일: 2025-08-01
 * 수정일: 2025-08-01
 */

/* ===================================
 * 전역 스타일 설정
 * ===================================
 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 50%, #fff3e0 100%);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

.container-fluid {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    margin: 15px;
    min-height: calc(100vh - 30px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===================================
 * 공통 버튼 기본 스타일
 * ===================================
 */
.btn {
    font-weight: 700;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===================================
 * 헤더 영역 스타일
 * ===================================
 */
h1 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    font-weight: 800;
    letter-spacing: -1px;
}

/* 헤더 버튼 (소리, 전체화면) */
.btn-outline-secondary,
.btn-outline-primary {
    border: 2px solid #e9ecef;
    color: #495057;
    background: #ffffff;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* ===================================
 * 타이머 원형 디스플레이 스타일
 * ===================================
 */
.timer-container {
    perspective: 1000px;
    position: relative;
	margin-bottom: 40px !important;
}

/* 일반 모드 타이머 원형 */
.timer-circle {
    width: 380px;
    height: 380px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    padding: 25px;
}

/* 타이머 SVG 공통 스타일 */
.timer-svg,
.fullscreen-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

/* 타이머 프로그레스 바 배경 */
.timer-bg {
    fill: none;
    stroke: #f1f3f4;
    stroke-width: 10;
}

/* 타이머 프로그레스 바 */
.timer-progress {
    fill: none;
    stroke: #dc3545;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 타이머 텍스트 영역 */
.timer-text,
.fullscreen-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 시간 표시 텍스트 */
.time-display {
	font-size: 2.8rem !important; /* 기존 3rem에서 조금 줄임 */
	font-weight: 700 !important;
	color: #495057 !important;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1) !important;
	line-height: 1.1 !important;
}

/* ===================================
 * 시간 설정 영역 스타일
 * ===================================
 */
.time-input {
    width: 80px;
    font-size: 1.6rem;
    font-weight: 700;
    border: 3px solid #e9ecef;
    background: #ffffff;
    border-radius: 15px;
    color: #495057;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.time-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    background: #ffffff;
    outline: none;
    transform: translateY(-2px);
}

.time-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.time-input-group span {
    color: #495057;
    font-size: 1.6rem;
    font-weight: 700;
}

/* ===================================
 * 빠른 설정 버튼 스타일
 * ===================================
 */
.quick-time {
    border: 3px solid #28a745;
    background: #ffffff;
    color: #28a745;
    font-weight: 700;
    border-radius: 20px;
    padding: 12px 20px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
    font-size: 0.95rem;
}

.quick-time:hover {
    background: #28a745;
    border-color: #28a745;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

/* ===================================
 * 컨트롤 버튼 색상별 스타일
 * ===================================
 */
.control-buttons .btn {
    min-width: 120px;
    padding: 14px 28px;
    font-size: 1rem;
    margin: 4px;
}

.control-buttons .btn:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 각 색상별 버튼 스타일 */
.btn-success {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-primary {
    background: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

.btn-info {
    background: #17a2b8;
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover:not(:disabled) {
    background: #138496;
}

/* ===================================
 * 전체화면 모드 스타일
 * ===================================
 */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 전체화면 컨텐츠 레이아웃 개선 */
.fullscreen-content {
	padding: 80px 20px 20px 20px !important; /* 상단 여백 추가 */
	box-sizing: border-box !important;
}

/* 전체화면 타이머를 더 중앙에 배치 */
.fullscreen-timer-container {
	margin-top: auto !important;
	margin-bottom: 80px !important; /* 하단 여백 더 증가 */
	flex-shrink: 0 !important;
}

.fullscreen-timer-circle {
    width: 500px;
    height: 500px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 30px;
}

.timer-progress-fullscreen {
    fill: none;
    stroke: #dc3545;
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 전체화면 모드 타이머 텍스트 */
.fullscreen-time-display {
	font-size: 4.2rem !important;
	font-weight: 700 !important;
	color: #333333 !important; /* 검정색으로 변경 */
	text-shadow: none !important; /* 그림자 효과 제거 */
	line-height: 1.1 !important;
	letter-spacing: 0.05em !important;
}

#exitFullscreenBtn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    border: none;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

#exitFullscreenBtn:hover {
    background: #218838;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* ===================================
 * 애니메이션 효과
 * ===================================
 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

.timer-circle.pulsing {
    animation: pulse 1.5s infinite;
}

/* 타이머 색상 상태별 스타일 */
.timer-circle.warning .timer-progress,
.fullscreen-timer-circle.warning .timer-progress-fullscreen {
    stroke: #ffc107;
    filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.4));
}

.timer-circle.danger .timer-progress,
.fullscreen-timer-circle.danger .timer-progress-fullscreen {
    stroke: #dc3545;
    filter: drop-shadow(0 0 8px rgba(220, 53, 69, 0.4));
}

/* ===================================
 * 완료 알림 스타일
 * ===================================
 */
.completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.completion-message {
    background: #ffffff;
    color: #495057;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: completionBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.completion-message h2 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #28a745, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.completion-message i {
    font-size: 6rem;
    margin-bottom: 25px;
    display: block;
    color: #28a745;
    filter: drop-shadow(0 5px 15px rgba(40, 167, 69, 0.3));
}

.completion-message p {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 500;
}

@keyframes completionBounce {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    70% {
        transform: scale(0.98) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* ===================================
 * 추가 효과 및 유틸리티
 * ===================================
 */
/* 타이머 원형 호버 효과 */
.timer-circle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timer-circle:hover::before {
    opacity: 1;
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* ===================================
 * 반응형 디자인 - 태블릿 (768px 이하)
 * ===================================
 */
@media (max-width: 768px) {
    .container-fluid {
        margin: 10px;
        min-height: calc(100vh - 20px);
        border-radius: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    /* 타이머 원형 크기 조정 */
    .timer-circle {
        width: 320px;
        height: 320px;
        padding: 20px;
    }
    
    .time-display {
		font-size: 2.2rem !important;
	}
	
	.fullscreen-content {
		padding: 60px 15px 15px 15px !important;
	}
	
	.fullscreen-timer-container {
		margin-bottom: 60px !important;
	}
	
	.time-display {
		font-size: 2.2rem !important;
	}
	
	.fullscreen-time-display {
		font-size: 3.5rem !important;
	}
    
    /* 입력 필드 크기 조정 */
    .time-input {
        width: 70px;
        font-size: 1.4rem;
    }
    
    /* 버튼 레이아웃 및 크기 조정 */
    .control-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .control-buttons .btn {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 12px 20px;
        margin: 2px;
    }
    
    .quick-time {
        font-size: 0.9rem;
        padding: 10px 16px;
        margin: 2px;
    }
    
    /* 전체화면 모드 조정 */
    .fullscreen-timer-circle {
        width: 400px;
        height: 400px;
        padding: 25px;
    }
    
       
    
}

/* ===================================
 * 반응형 디자인 - 모바일 (576px 이하)
 * ===================================
 */
@media (max-width: 576px) {
    .container-fluid {
        margin: 5px;
        min-height: calc(100vh - 10px);
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    /* 타이머 원형 모바일 최적화 */
    .timer-circle {
        width: 280px;
        height: 280px;
        padding: 18px;
    }
    
    .time-display {
        font-size: 2.6rem;
    }
    
    /* 입력 필드 모바일 최적화 */
    .time-input {
        width: 60px;
        font-size: 1.2rem;
    }
    
    .time-input-group span {
        font-size: 1.4rem;
    }
    
    /* 빠른 설정 버튼 모바일 최적화 */
    .quick-time {
        font-size: 0.75rem;
        padding: 8px 10px;
        margin: 2px;
        min-width: 55px;
        white-space: nowrap;
    }
    
    /* 컨트롤 버튼 모바일 레이아웃 (2-2-1 배치) */
    .control-buttons {
        padding: 0 10px;
        width: 100%;
        max-width: none;
    }
    
    .control-buttons .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .control-buttons .btn {
        flex: 1;
        min-width: calc(50% - 3px);
        max-width: calc(50% - 3px);
        font-size: 0.8rem;
        padding: 10px 8px;
        margin: 0;
        white-space: nowrap;
    }
    
    /* 첫 번째와 두 번째 버튼 (설정, 시작) */
    .control-buttons .btn:nth-child(1),
    .control-buttons .btn:nth-child(2) {
        width: calc(50% - 3px);
    }
    
    /* 세 번째와 네 번째 버튼 (일시정지, 리셋) */
    .control-buttons .btn:nth-child(3),
    .control-buttons .btn:nth-child(4) {
        width: calc(50% - 3px);
    }
    
    /* 다섯 번째 버튼 (클리어) - 전체 너비 */
    .control-buttons .btn:nth-child(5) {
        width: 100%;
        margin-top: 6px;
    }
    
    /* 전체화면 모드 모바일 최적화 */
    .fullscreen-timer-circle {
        width: 350px;
        height: 350px;
        padding: 20px;
    }
    
    .fullscreen-time-display {
        font-size: 3.8rem;
    }
    
    #exitFullscreenBtn {
        top: 15px;
        right: 15px;
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    

/* ===================================
 * 반응형 디자인 - 초소형 모바일 (400px 이하)
 * ===================================
 */
@media (max-width: 400px) {
    .container-fluid {
        margin: 2px;
        min-height: calc(100vh - 4px);
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    /* 타이머 원형 초소형 최적화 */
    .timer-circle {
        width: 200px;
        height: 200px;
        padding: 10px;
    }
    
    .fullscreen-content {
		padding: 40px 10px 10px 10px !important;
	}
	
	.fullscreen-timer-container {
		margin-bottom: 40px !important;
	}
	
	.time-display {
		font-size: 1.8rem !important;
	}
	
	.fullscreen-time-display {
		font-size: 2.8rem !important;
	}

    /* 입력 필드 초소형 최적화 */
    .time-input {
        width: 50px;
        font-size: 1.1rem;
    }
    
    .time-input-group span {
        font-size: 1.2rem;
    }
    
    /* 빠른 설정 버튼 초소형 최적화 */
    .quick-time {
        font-size: 0.7rem;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    /* 컨트롤 버튼 초소형 최적화 */
    .control-buttons .btn {
        font-size: 0.75rem;
        padding: 8px 6px;
    }
}

/* ===================================
 * 반응형 디자인 - 가로 모드 최적화
 * ===================================
 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 가로 모드에서는 공간 절약을 위해 크기 축소 */
    .timer-circle {
        width: 200px;
        height: 200px;
    }
    
    .time-display {
        font-size: 1.6rem;
    }
    
    .control-buttons .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .quick-time {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    /* 가로 모드에서는 이용 방법 숨기기 (공간 절약) */
    .usage-guide {
        display: none;
    }
}



/* ===================================
 * 광고 영역 스타일링
 * =================================== */
.webtools-ad {
    margin: 2rem 0;
    text-align: center;
    min-height: 250px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}