/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #a8dadc 0%, #457b9d 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px;
}

/* 입력 섹션 */
.input-section {
    margin-bottom: 30px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.input-header label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #555;
}

.input-controls {
    display: flex;
    gap: 10px;
}

.clear-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.clear-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
}

#textInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

#textInput:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* 실시간 분석 결과 (텍스트 입력 바로 아래) */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%);
    color: white;
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #333;
}

.stat-card.highlight h3 {
    color: white;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.stat-row:last-of-type {
    margin-bottom: 0;
}

.stat-row .label {
    font-size: 0.9rem;
    color: #666;
}

.stat-card.highlight .stat-row .label {
    color: rgba(255, 255, 255, 0.9);
}

/* 숫자와 단위 사이 공백 조정 */
.value-with-unit {
    display: flex;
    align-items: center;
}

.value-with-unit .value {
    font-weight: 700;
    color: #2196f3;
    margin-right: 4px; /* 한 칸 공백 */
}

.value-with-unit .unit {
    font-weight: normal;
    color: #333; /* 기본 컬러 */
}

.stat-card.highlight .value-with-unit .value {
    color: white;
}

.stat-card.highlight .value-with-unit .unit {
    color: white;
}

.large-value {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    color: white;
}

.description {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    font-style: italic;
}

.stat-card.highlight .description {
    color: rgba(255, 255, 255, 0.8);
}

/* 목표 발표시간 설정 (3칸으로 분할) */
.target-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border: 1px solid #e9ecef;
}

.section-title {
    color: #495057;
    font-size: 1.3rem;
    margin-bottom: 25px;
    text-align: center;
}

.target-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.target-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.target-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.target-card h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #495057;
    text-align: center;
    flex-shrink: 0;
}

/* 1칸: 현재 목표 시간 */
.current-target {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2칸: 시간 조정 버튼들 (+20분 버튼 추가로 5개 버튼) */
.time-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
    align-content: start;
}

.time-btn, .reset-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-weight: 500;
}

.time-btn:hover {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1976d2;
}

.reset-btn {
    grid-column: 1 / -1;
    background: #fff3e0;
    border-color: #ffcc02;
    color: #f57c00;
}

.reset-btn:hover {
    background: #ffe0b2;
    border-color: #ff9800;
}

/* 3칸: 예상 필요 글자수 */
.expected-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.expected-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.expected-row:last-child {
    border-bottom: none;
}

.expected-row .label {
    font-size: 0.9rem;
    color: #666;
}

/* 예상 필요 글자수 스타일 수정 */
.expected-value-with-unit {
    display: flex;
    align-items: center;
}

.expected-value-with-unit .expected-value {
    font-weight: 600;
    color: #2196f3;
    margin-right: 4px; /* 한 칸 공백 */
}

.expected-value-with-unit .expected-unit {
    font-weight: normal; /* 볼드 해제 */
    color: #333; /* 기본 컬러 */
}

footer {
    background: #f8f9fa;
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

footer p {
    color: #666;
    font-size: 0.95rem;
}

/* 반응형 디자인 수정 */
@media (max-width: 900px) {
    .target-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .target-card {
        min-height: auto;
    }
    
    .current-target {
        font-size: 1.5rem;
        padding: 15px;
    }
    
    .time-buttons {
        grid-template-columns: 1fr;
    }
}

/* 중간 크기 화면에서도 3칸 유지 */
@media (min-width: 901px) and (max-width: 1200px) {
    .target-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
    }
    
    .target-card {
        padding: 20px;
    }
    
    .current-target {
        font-size: 1.8rem;
    }
}

/* 기본 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 30px 20px;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    footer {
        padding: 20px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .target-card {
    animation: fadeIn 0.5s ease-out;
}
