/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 헤더 */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 탭 네비게이션 */
.tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    max-width: 150px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 탭 콘텐츠 */
.tab-content {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 입력 좌우 레이아웃 */
.input-bilingual {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
}

.input-col {
    flex: 1;
    padding: 12px;
}

.input-col:first-child {
    border-right: 2px solid #e1e5e9;
}

.input-col label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-col textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    background: transparent;
    transition: background 0.2s;
}

.input-col textarea:focus {
    outline: none;
    background: rgba(102, 126, 234, 0.05);
}

.input-bilingual:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 입력 섹션 */
.input-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 요일 선택 드롭다운 */
.day-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.day-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 날짜 입력 필드 */
.date-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 버튼 */
.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
}

.secondary-btn:hover {
    background: #667eea;
    color: white;
}

.secondary-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.primary-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* 목록 섹션 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 필터 컨트롤 */
.filter-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: end;
}

.day-filter {
    min-width: 150px;
}

.day-filter label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.search-box {
    flex: 1;
}

/* 데이터 관리 컨트롤 */
.data-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.data-controls button {
    font-size: 14px;
    padding: 8px 16px;
}

.list-header h2 {
    color: #667eea;
    font-size: 1.8rem;
}

.count {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}


.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 문장 카드 */
.sentence-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sentence-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 영어/한글 좌우 레이아웃 */
.sentence-bilingual {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    align-items: stretch;
}

.sentence-left,
.sentence-right {
    flex: 1;
    padding: 12px 16px;
}

.sentence-left {
    border-right: 2px solid #dee2e6;
}

.sentence-english {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
}

.sentence-korean {
    color: #666;
    font-style: italic;
    line-height: 1.5;
}

.sentence-date {
    font-size: 0.8rem;
    color: #aaa;
    text-align: right;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* 복습 섹션 */
.review-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

/* 복습 필터 */
.review-filter {
    display: flex;
    gap: 15px;
    align-items: end;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.review-filter label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.review-filter .day-select {
    min-width: 150px;
}

.review-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 3px solid #667eea;
}

.review-english {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
}

.review-korean {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-controls {
    text-align: center;
    margin-bottom: 20px;
}

.review-stats {
    text-align: center;
    color: #666;
    font-weight: 600;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    color: #888;
    padding: 40px;
}

.empty-state p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .tab-content {
        padding: 20px;
    }

    .tab-nav {
        flex-direction: column;
        border-radius: 15px;
    }

    .tab-btn {
        max-width: none;
        margin: 2px 0;
        border-radius: 10px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-controls {
        flex-direction: column;
        gap: 15px;
    }

    /* 문장 목록: 모바일에서 세로 배치 */
    .sentence-bilingual {
        flex-direction: column;
    }

    .sentence-left {
        border-right: none;
        border-bottom: 2px solid #dee2e6;
    }

    /* 모바일 가로 스크롤 방지 */
    .sentence-card {
        overflow: hidden;
    }

    .sentence-card:hover {
        transform: none;
    }

    /* 문장 추가: 모바일에서 세로 배치 */
    .input-bilingual {
        flex-direction: column;
    }

    .input-col:first-child {
        border-right: none;
        border-bottom: 2px solid #e1e5e9;
    }

    .review-filter {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .review-card {
        padding: 25px;
        min-height: 150px;
    }

    .review-english {
        font-size: 1.2rem;
    }

    .review-korean {
        font-size: 1rem;
    }
}

/* 날짜 헤더 */
.date-header {
    color: #667eea;
    margin: 20px 0 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* 알림 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
    word-wrap: break-word;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 폼 액션 버튼들 */
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 20px;
}

/* 수정 버튼 스타일 */
.edit-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

/* 문장 카드 액션 버튼들 */
.sentence-actions {
    display: flex;
    gap: 5px;
    align-self: flex-end;
    margin-bottom: 5px;
}

/* 카드 페어 */
.card-pair {
    border: 2px solid #e1e5e9;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fdfdff;
    transition: border-color 0.2s;
}

.card-pair:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

.card-pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-pair-label {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
}

.remove-card-btn {
    background: none;
    border: 1.5px solid #dc3545;
    color: #dc3545;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: none;
    transition: all 0.2s;
    padding: 0;
}

.remove-card-btn:hover {
    background: #dc3545;
    color: white;
}

/* 카드 추가 버튼 */
.add-card-wrapper {
    text-align: center;
    margin-bottom: 16px;
}

.add-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border: 2px dashed #667eea;
    border-radius: 25px;
    background: transparent;
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.add-card-btn:hover {
    background: rgba(102, 126, 234, 0.08);
    border-style: solid;
}

/* 카드 내 input-bilingual 여백 조정 */
.card-pair .input-bilingual {
    margin-bottom: 12px;
}

.card-pair .input-group {
    margin-bottom: 0;
}


/* 스크린 리더 전용 (시각적으로 숨김) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
