.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #1e293b;
}

.home-link {
    color: #1e293b;
    text-decoration: none;
}

.home-link:hover {
    color: #667eea;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover {
    color: #667eea;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.add-form {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.add-form h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #1e293b;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #5568d3;
}

.sentences {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sentence-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    position: relative;
}

.sentence-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sentence-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    position: sticky;
    top: 60px; /* Below site header (60px) */
    background: white;
    z-index: 100; /* Below site header (1000) but above content */
    padding: 12px 15px;
    margin: -20px -20px 12px -20px;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
    transition: box-shadow 0.2s;
}

.sentence-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.06), transparent);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.sentence-meta {
    font-size: 0.85rem;
    color: #64748b;
}

.sentence-actions {
    display: flex;
    gap: 8px;
}

.btn-practice {
    background: #10b981;
    padding: 8px 16px;
    font-size: 0.9rem;
    position: relative;
}

.btn-practice:hover:not(:disabled) {
    background: #059669;
}

.btn-practice:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loading spinner for practice button */
.btn-practice.loading::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-edit {
    background: #f59e0b;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-edit:hover {
    background: #d97706;
}

.btn-delete {
    background: #ef4444;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: #dc2626;
}

.sentence-content {
    color: #1e293b;
    line-height: 1.6;
    margin-bottom: 8px;
}

.sentence-versions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.version-item {
    padding: 8px 0;
    color: #475569;
    line-height: 1.6;
}

.practice-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

/* Practice badge shine animation */
@keyframes practice-shine {
    0%, 100% {
        background: #dbeafe;
        transform: scale(1);
    }
    50% {
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    }
}

.practice-badge.animate {
    animation: practice-shine 0.6s ease-in-out;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    background: #e2e8f0;
    color: #64748b;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.modal-close:hover {
    background: #cbd5e1;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background: #94a3b8;
}

.btn-cancel:hover {
    background: #64748b;
}

/* Date group styles */
.date-group {
    margin-bottom: 25px;
}

.date-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.date-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.date-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.date-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.date-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.date-header.collapsed .date-toggle {
    transform: rotate(-90deg);
}

.date-sentences {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 10px;
}

.date-sentences.collapsed {
    display: none;
}

/* Date filter styles */
.date-filter {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    border: 1px solid #e2e8f0;
}

.filter-inputs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-inputs label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-inputs label span {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.filter-inputs input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
}

/* Practice Count Filter Select Styling */
#filter-practice-count {
    padding: 10px 40px 10px 16px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: #4338ca;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image:
        linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234338ca' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 160px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

#filter-practice-count:hover {
    border-color: #5568d3;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

#filter-practice-count:focus {
    outline: none;
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Add icon before the select */
.filter-inputs label:has(#filter-practice-count) {
    position: relative;
}

.filter-inputs label:has(#filter-practice-count) span::before {
    content: "🎯 ";
    font-size: 1rem;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-filter {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-filter:hover {
    background: #5568d3;
}

.btn-filter-clear {
    background: #94a3b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-filter-clear:hover {
    background: #64748b;
}

.filter-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Load more button */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 30px 0;
}

.load-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Sticky original text for translation and fixing tools */
.vietnamese-text,
.original-text {
    position: -webkit-sticky;
    position: sticky;
    top: 124px; /* Below site header (60px) + sentence header (~64px) */
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 15px 20px;
    margin: 0 -20px 15px -20px;
    border-bottom: 2px solid #0ea5e9;
    border-left: 4px solid #0ea5e9;
    font-size: 1.05rem;
    font-weight: 500;
    color: #0c4a6e;
    z-index: 90; /* Below sentence header (100) */
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sentence-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px;
        top: 60px; /* Same as desktop - site header height */
    }

    .sentence-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .btn-practice,
    .btn-edit,
    .btn-delete {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .vietnamese-text,
    .original-text {
        top: 144px; /* Site header (60px) + taller mobile sentence header (~84px) */
        font-size: 0.95rem;
        padding: 12px 15px;
    }
}
