/* ============================================================================
   SPACED REPETITION HERO ZONE STYLES
   ============================================================================ */

/* Hero Zone Container */
#spaced-repetition-hero {
    background: linear-gradient(135deg, rgba(9, 190, 188, 0.08) 0%, rgba(30, 41, 59, 0.08) 100%);
    border: 2px solid rgba(9, 190, 188, 0.3);
    border-radius: 0;
    padding: 24px 32px 40px;
    margin: 0 auto 48px;
    max-width: 1200px;
    display: none; /* Hidden by default, shown by JS */
    position: relative;
    overflow: hidden;
}

/* Tabs */
.sr-hero-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0;
}

.sr-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0;
}

.sr-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.sr-tab-btn:hover {
    color: #cbd5e1;
}

.sr-tab-btn.active {
    color: #09BEBC;
}

.sr-tab-btn.active::after {
    background: #09BEBC;
}

.sr-tab-content {
    animation: fadeIn 0.3s ease;
}

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

#spaced-repetition-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, #09BEBC 50%, transparent 100%);
}

/* Hero Header */
.sr-hero-header {
    text-align: center;
    margin-bottom: 32px;
}

.sr-hero-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sr-hero-header p {
    font-size: 1.125rem;
    color: #cbd5e1;
    font-weight: 400;
}

.sr-hero-header p strong {
    color: #09BEBC;
    font-weight: 700;
}

/* Empty State */
.sr-hero-empty {
    text-align: center;
    padding: 60px 20px;
}

.sr-empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: grayscale(0);
}

.sr-hero-empty h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.sr-hero-empty p {
    font-size: 1rem;
    color: #cbd5e1;
}

/* Reviews Grid */
.sr-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Review Card */
.sr-review-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(9, 190, 188, 0.2);
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.sr-review-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(9, 190, 188, 0.4);
    border-color: #09BEBC;
    background: rgba(9, 190, 188, 0.08);
}

/* Card Badge */
.sr-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #09BEBC 0%, #07a19f 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(9, 190, 188, 0.4);
}

/* Overdue Badge */
.sr-card-badge-overdue {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: pulse-overdue 2s ease-in-out infinite;
}

@keyframes pulse-overdue {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Overdue Card */
.sr-review-card.sr-card-overdue {
    border-color: rgba(239, 68, 68, 0.4);
}

.sr-review-card.sr-card-overdue:hover {
    border-color: #ef4444;
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.4);
}

/* Recommended Card - New lesson suggestions */
.sr-review-card.sr-recommended-card {
    border-color: rgba(168, 85, 247, 0.3);
}

.sr-review-card.sr-recommended-card:hover {
    border-color: #a855f7;
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
}

/* New Badge for recommended lessons */
.sr-card-badge-new {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

/* New Button style for recommended lessons */
.sr-card-btn-new {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.sr-card-btn-new:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

/* Card Image */
.sr-card-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.sr-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(30, 41, 59, 0.9) 0%, transparent 100%);
}

.sr-card-image-placeholder {
    background: linear-gradient(135deg, #1E293B 0%, #2d3e54 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-placeholder-icon {
    font-size: 3rem;
    opacity: 0.3;
    filter: grayscale(1);
}

/* Card Content */
.sr-card-content {
    padding: 24px 20px;
}

.sr-card-content h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sr-card-meta {
    font-size: 0.875rem;
    color: #cbd5e1;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Card Button */
.sr-card-btn {
    width: 100%;
    background: linear-gradient(135deg, #09BEBC 0%, #07a19f 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(9, 190, 188, 0.3);
}

.sr-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(9, 190, 188, 0.5);
    background: linear-gradient(135deg, #0ac9c7 0%, #08b2b0 100%);
}

.sr-card-btn:active {
    transform: translateY(0);
}

/* ============================================================================
   LESSON DETAIL - REVIEW COMPLETION PROMPT
   ============================================================================ */

/* Review Completion Overlay - Pure flexbox centering (like "Sẵn sàng học!") */
.sr-completion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem; /* Uniform padding - NO padding-top/bottom specific */
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Completion Modal */
.sr-completion-modal {
    background: linear-gradient(135deg, #1E293B 0%, #2d3e54 100%);
    border: 0.125rem solid #09BEBC;
    border-radius: 0;
    padding: 2.5rem 2rem;
    max-width: 31.25rem; /* 500px */
    width: 100%;
    text-align: center;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.5);
    max-height: 70vh; /* Giảm để fit với padding-bottom của overlay */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(1.875rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sr-completion-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: linear-gradient(90deg, transparent 0%, #09BEBC 50%, transparent 100%);
}

.sr-completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.sr-completion-modal h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.sr-completion-modal p {
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

/* Rating Section */
.sr-rating-section {
    margin: 2rem 0;
    flex-shrink: 0;
}

.sr-rating-section label {
    display: block;
    font-size: 1rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.sr-rating-stars {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sr-star {
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    filter: grayscale(1);
    opacity: 0.3;
    line-height: 1;
}

.sr-star:hover,
.sr-star.active {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.2);
}

.sr-rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* Action Buttons */
.sr-completion-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-shrink: 0;
}

.sr-completion-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 2.75rem; /* Touch-friendly */
}

.sr-btn-primary {
    background: linear-gradient(135deg, #09BEBC 0%, #07a19f 100%);
    color: white;
    box-shadow: 0 0.25rem 0.75rem rgba(9, 190, 188, 0.3);
}

.sr-btn-primary:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(9, 190, 188, 0.5);
}

.sr-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 0.125rem solid rgba(255, 255, 255, 0.2);
}

.sr-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   RESPONSIVE - Dùng đơn vị REM
   ============================================================================ */

/* TABLET & MOBILE (Portrait) */
@media (max-width: 768px) {
    #spaced-repetition-hero {
        padding: 2rem 1.25rem;
        margin-bottom: 2rem;
    }

    .sr-hero-header h2 {
        font-size: 1.5rem;
    }

    .sr-hero-header p {
        font-size: 1rem;
    }

    .sr-reviews-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sr-card-image {
        height: 9.375rem;
    }

    /* Modal - Keep centered */
    .sr-completion-overlay {
        padding: 1rem; /* Keep uniform - flexbox handles centering */
    }

    .sr-completion-modal {
        padding: 1.5rem 1.25rem;
        max-height: 65vh; /* Giảm để đảm bảo buttons visible */
    }

    .sr-completion-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }

    .sr-completion-modal h3 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .sr-completion-modal p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .sr-rating-section {
        margin: 1.25rem 0;
    }

    .sr-rating-section label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .sr-rating-stars {
        gap: 0.5rem;
    }

    .sr-star {
        font-size: 2rem;
    }

    .sr-rating-labels {
        font-size: 0.75rem;
    }

    .sr-completion-actions {
        flex-direction: column;
        gap: 0.625rem;
        margin-top: 1.25rem;
    }

    .sr-completion-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* EXTRA SMALL SCREENS (iPhone SE, etc.) */
@media (max-width: 380px) {
    .sr-completion-overlay {
        padding: 0.75rem; /* Keep uniform */
    }

    .sr-completion-modal {
        padding: 1.25rem 1rem;
        max-height: 60vh;
    }

    .sr-completion-icon {
        font-size: 2.5rem;
        margin-bottom: 0.625rem;
    }

    .sr-completion-modal h3 {
        font-size: 1.2rem;
    }

    .sr-rating-section {
        margin: 1rem 0;
    }

    .sr-star {
        font-size: 1.8rem;
    }

    .sr-completion-btn {
        padding: 0.6875rem 1.125rem;
        font-size: 0.9rem;
    }
}

/* DESKTOP & TABLET LANDSCAPE */
@media (min-width: 769px), (orientation: landscape) and (min-height: 501px) {
    .sr-completion-overlay {
        padding: 2rem; /* Keep uniform */
    }

    .sr-completion-modal {
        max-height: 80vh;
    }
}

/* LANDSCAPE MODE - Màn hình ngang thấp */
@media (max-height: 500px) and (orientation: landscape) {
    .sr-completion-overlay {
        padding: 1rem; /* Keep uniform */
    }

    .sr-completion-modal {
        max-height: 80vh;
        max-width: 50rem;
        padding: 1rem 1.25rem;
    }

    /* Compact layout cho landscape */
    .sr-completion-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .sr-completion-modal h3 {
        font-size: 1.1rem;
        margin-bottom: 0.375rem;
    }

    .sr-completion-modal p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .sr-rating-section {
        margin: 0.75rem 0;
    }

    .sr-rating-section label {
        font-size: 0.85rem;
        margin-bottom: 0.375rem;
    }

    .sr-rating-stars {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .sr-star {
        font-size: 1.6rem;
    }

    .sr-rating-labels {
        font-size: 0.7rem;
        margin-top: 0.25rem;
    }

    .sr-completion-actions {
        flex-direction: row; /* Horizontal buttons cho landscape */
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .sr-completion-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        min-height: 2.25rem;
    }
}

/* PORTRAIT MODE với màn hình thấp */
@media (max-height: 650px) and (orientation: portrait) {
    .sr-completion-overlay {
        padding: 1rem; /* Keep uniform */
    }

    .sr-completion-modal {
        max-height: 60vh;
        padding: 1.25rem 1rem;
    }

    .sr-completion-icon {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .sr-completion-modal h3 {
        font-size: 1.2rem;
        margin-bottom: 0.375rem;
    }

    .sr-completion-modal p {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .sr-rating-section {
        margin: 1rem 0;
    }

    .sr-star {
        font-size: 1.8rem;
    }

    .sr-completion-actions {
        margin-top: 1rem;
        gap: 0.5rem;
    }

    .sr-completion-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.sr-review-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.sr-review-card:nth-child(1) { animation-delay: 0.1s; }
.sr-review-card:nth-child(2) { animation-delay: 0.2s; }
.sr-review-card:nth-child(3) { animation-delay: 0.3s; }
.sr-review-card:nth-child(4) { animation-delay: 0.4s; }
.sr-review-card:nth-child(5) { animation-delay: 0.5s; }

/* ============================================================================
   PWA STANDALONE MODE - No special padding needed, flexbox centers perfectly
   ============================================================================ */
/* REMOVED: All PWA-specific padding overrides - flexbox centering works universally */

/* ============================================================================
   PAGINATION
   ============================================================================ */

.sr-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding: 20px 0;
}

.sr-pagination-btn {
    background: linear-gradient(135deg, #09BEBC 0%, #07a19f 100%);
    color: white;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(9, 190, 188, 0.3);
    flex-shrink: 0;
}

.sr-pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(9, 190, 188, 0.5);
    background: linear-gradient(135deg, #0ac9c7 0%, #08b2b0 100%);
}

.sr-pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.sr-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: #64748b;
}

/* Page number badges */
.sr-pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    max-width: 100%;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.sr-pagination-pages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.sr-page-badge {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 12px;
    flex-shrink: 0;
}

.sr-page-badge:hover {
    background: rgba(9, 190, 188, 0.2);
    border-color: rgba(9, 190, 188, 0.5);
    color: #09BEBC;
    transform: translateY(-2px);
}

.sr-page-badge.active {
    background: linear-gradient(135deg, #09BEBC 0%, #07a19f 100%);
    color: white;
    border-color: #09BEBC;
    box-shadow: 0 4px 12px rgba(9, 190, 188, 0.4);
}

.sr-page-badge.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(9, 190, 188, 0.6);
}

/* Mobile optimization */
@media (max-width: 768px) {
    .sr-pagination {
        gap: 8px;
        padding: 16px 0;
    }

    .sr-pagination-pages {
        gap: 6px;
        max-width: calc(100vw - 120px); /* Space for prev/next buttons */
    }
    
    .sr-page-badge {
        min-width: 36px;
        height: 36px;
        font-size: 0.875rem;
        padding: 0 10px;
        border-radius: 6px;
    }
    
    .sr-pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .sr-pagination {
        gap: 6px;
    }

    .sr-pagination-pages {
        gap: 4px;
        max-width: calc(100vw - 100px);
    }
    
    .sr-page-badge {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
        padding: 0 8px;
        border-radius: 6px;
    }
    
    .sr-pagination-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-radius: 6px;
    }
}

