@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Oswald:wght@200..700&family=Poppins:ital,wght@0,100..900;1,100..900&family=Source+Serif+4:ital,wght@0,400;0,500;1,400&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --LogoColour: #F6318C;
    --HeaderColour: #00246B;
}

main {
    display: flex;
    flex-direction: column;
    width: 100% !important;
}

body {
    background: linear-gradient(180deg, #eef0f3 0%, #dfe4ea 100%);
}

#AddReviewContainer
{
    z-index: 1000 !important;
}



/* Heading fade-in only */
#newHeading {
    font-family: 'Poppins', sans-serif;
    font-size: 2.1rem;
    color: var(--HeaderColour);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 2px 10px 7px rgba(0, 0, 0, 0.2);
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

/* Container bottom-up fade-in */
.newRevContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-top: 10px;
    padding: 40px 20px;
    width: 85% !important;
    margin-left: auto;
    grid-template-columns: repeat(auto-fit, minmax(370px, 1fr));
    justify-content: center;
    margin-right: auto;
    opacity: 0;
    transform: translateY(25px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.2s; /* starts after heading */
}

/* Keyframes */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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


.newRevCard {
    width: 370px;
    height: 450px; /* Keep fixed height */
    background-color: #ffffff;
    border-radius: 16px;
    display: flex;
    padding: 20px;
    justify-content: space-between;
    align-items: stretch;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    justify-self: center;
    justify-content: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.newRevCard:hover {
    /* Enhanced modern shadow */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    
    /* Subtle lift effect */
    transform: translateY(-12px);
    
    /* Clean white hover state */
    background-color: #fafafa;
    border-color: rgba(0, 0, 0, 0.12);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .newRevContainer {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 16px;
        margin-top: 24px;
    }
    
    .newRevCard {
        width: 90%;
        max-width: 370px;
        height: 380px;
        padding: 18px;
        border-radius: 12px;
        justify-self: center;
    }
}

#quote-icon {
    align-self: flex-start;
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    opacity: 1;
}

.review-text {
    font-family: 'Poppins', sans-serif;
    font-family: 'Source Serif 4', serif;
    font-size: 1.1rem;
    text-align: start;
    color: #393E46;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0;
    display: block;
    overflow: visible;
    flex: unset; /* Don't use flex: 1 */
    max-height: 280px; /* Constrain the text height */
}

.read-more-link {
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline;
    font-family: 'Oswald', sans-serif;
}

.read-more-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.student-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: auto; /* This pushes it to bottom */
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    flex-shrink: 0;
}

.student-image {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
 user-select: none; 
    /* Soft shadow for depth */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.08);

    /* Elegant outline to make it stand out on light backgrounds */
    border: 2px solid rgba(255, 255, 255, 0.8);

    /* Optional subtle glow */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.student-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18),
                0 3px 6px rgba(0, 0, 0, 0.1);
}






.student-initials{
   width: 65px;
    height: 65px;

  border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:800; font-size:22px; user-select:none;
  color: #1E2A3B; /* tweak as needed */
  /* font-family: 'Montserrat','Poppins', sans-serif; */
  font-family: 'Work Sans', cursive;
  background-color: #E6F0FF;

   /* Soft shadow for depth */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.08);

    /* Elegant outline to make it stand out on light backgrounds */
    border: 2px solid rgba(255, 255, 255, 0.8);
}



.student-name-and-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.student-name {
    font-family: 'Poppins', sans-serif;
    font-family: 'Work Sans', sans-serif; /* Try 'Montserrat' or 'Work Sans' if preferred */
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

#student-info {
    font-size: 14px;
    color: #666;
    margin: 0 0 2px 0;
    font-weight: 500;
}

.student-school {
    font-family: 'Poppins', sans-serif;
    font-size: 14.5px;
    color: #888;
    margin: 0;
    font-weight: 800;
    margin-top: 1px;
    margin-left: 1px !important;
    color: var(--LogoColour);
}

.result-link {
    font-size: 14px;
    font-family: 'Poppins','Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(90deg, var(--HeaderColour), #4a90e2, #ff6f61, var(--HeaderColour));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: linkGradientSlide 3s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.result-link:hover {
    text-decoration: underline;
    animation-play-state: paused; /* Pause animation on hover for clarity */
    opacity: 1;
}

@keyframes linkGradientSlide {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}


/* Small mobile */
@media (max-width: 576px) {
    #newHeading {
        font-size: 1.6rem;
        margin-top: 20px;
    }
    .newRevContainer {
        width: 90% !important;
        padding: 20px 10px;
        gap: 20px;
        justify-content: center;
        grid-template-columns: 1fr; /* Always one card per row */
        margin-top: 0px !important;
        /* background-color: red; */
    }
    .newRevCard {
        width: 350px; /* fixed */
        height: auto; /* fixed */
        padding: 16px;
        margin: 0 auto; /* center card */
        /* background-color: red !important; */
    }
    .review-text {
        max-height: none;
        margin-bottom: 5px;
    }
    .student-image {
        width: 60px;
        height: 60px;
    }

    .student-initials{
   width: 55px;
    height: 55px;
    }
    .student-name {
        font-size: 16px;
    }
}

/* Tablet fix for 620â€"770px range */
@media (min-width: 620px) and (max-width: 770px) {
    .newRevCard {
        /* width: auto; */
        width: 90% !important;
        height: auto;
        max-width: 90% !important;
        
    }
}

@media (min-width: 770px) and (max-width: 1024px) {
    .newRevContainer {
        width: 100% !important;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        justify-content: center;
    }
}
/* ===============================
   MODAL STYLES - UPDATED
   =============================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

/* Modal Container */
.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    /* Ensure centering on all screen sizes */
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Close Button */
.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    z-index: 10;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background-color: #fff;
    transform: scale(1.1);
}

/* Modal specific card styling - Override default card styles when in modal */
.modal-overlay .newRevCard {
    height: auto !important; /* Auto height for modal */
    cursor: default !important; /* Remove pointer cursor */
    transform: none !important; /* Remove any transforms */
    width: 100% !important; /* Full width of container */
    max-width: 500px !important; /* Max width constraint */
    margin: 0 auto !important; /* Center the card */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important; /* Enhanced shadow for modal */
}

/* Modal card hover state - disable hover effects */
.modal-overlay .newRevCard:hover {
    transform: none !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    /* background-color: #ffffff !important; */
    
    
}

/* Modal review text - no height constraint */
.modal-overlay .review-text {
    max-height: none !important; /* Allow full text to show */
    overflow: visible !important;
    display: block !important;
}

/* Modal quote icon - same styling */
.modal-overlay #modal-quote-icon {
    align-self: flex-start;
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    opacity: 0.7;
}

/* Tablet and medium screens */
@media (max-width: 768px) {
    .modal-close {
        top: -30px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    .modal-container {
        width: 95%;
        max-width: 95%;
        margin: 0;
        /* Maintain centering */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .modal-overlay .newRevCard {
        width: 100% !important;
        max-width: 100% !important;
        padding: 18px !important;
        margin: 0 !important;
    }
}

/* Mobile screens - 576px and below */
@media (max-width: 576px) {
    .modal-container {
        width: 95% !important;
        height: 90% !important;
        max-width: 95% !important;
        max-height: 90% !important;
        padding: 10px;
        margin: 0 !important;
        /* Ensure perfect centering on mobile */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        /* Remove flex properties that might interfere */
        display: block;
    }
    
    .modal-close {
        top: -35px;
        right: 5px;
        width: 28px;
        height: 28px;
        font-size: 18px;
        background: rgba(255, 255, 255, 0.95);
    }
    
    .modal-overlay .newRevCard {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        padding: 15px !important;
        margin: 0 !important;
        /* Ensure card fits within container */
        box-sizing: border-box;
    }

    /* Adjust heading for mobile modal */
    #newHeading {
        margin-bottom: 5px;
    }
    
    /* Ensure modal content is scrollable on mobile */
    .modal-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .modal-container {
        width: 98% !important;
        height: 95% !important;
        padding: 8px;
    }
    
    .modal-overlay .newRevCard {
        padding: 12px !important;
    }
    
    .modal-close {
        top: -30px;
        right: 2px;
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
}

/* Larger screens - ensure perfect centering */
@media (min-width: 1200px) {
    .modal-container {
        max-width: 700px;
        width: 60%;
        /* Enhanced centering for large screens */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
    }
    
    .modal-overlay .newRevCard {
        max-width: 600px !important;
        padding: 25px !important;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .modal-container {
        max-width: 800px;
        width: 50%;
    }
    
    .modal-overlay .newRevCard {
        max-width: 700px !important;
        padding: 30px !important;
    }
}

/* ===============================
   DARK MODE AUTO DETECTION
   =============================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode background */
    body {
        background: linear-gradient(180deg, #1a1a1a 0%, #2c2c2c 100%);
    }
    
    /* Dark mode heading */
    #newHeading {
        color: #ffffff;
        text-shadow: 2px 10px 7px rgba(255, 255, 255, 0.1);
    }
    
    /* Dark mode cards - lighter than background */
    .newRevCard {
        background-color: #404040;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    }
    
    .newRevCard:hover {
        background-color: #4a4a4a;
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    /* Dark mode text */
    .review-text {
        color: #e0e0e0;
    }
    
    .student-name {
        color: #ffffff;
    }
    
    #student-info {
        color: #b0b0b0;
    }
    
    .student-school {
        color: var(--LogoColour);
    }
    
    /* Dark mode student details border */
    .student-details {
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    /* Dark mode student initials */
    .student-initials {
        background-color: #555555;
        color: #ffffff;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Dark mode student image border */
    .student-image {
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Dark mode read more link */
    .read-more-link {
        color: #66b3ff;
    }
    
    .read-more-link:hover {
        color: #4da6ff;
    }
    
    /* Dark mode modal */
    .modal-overlay {
        background-color: rgba(0, 0, 0, 0.85);
    }
    
    .modal-close {
        background: rgba(64, 64, 64, 0.95);
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
    
    .modal-close:hover {
        background-color: #707070;
    }
    
    /* Dark mode modal card overrides */
    .modal-overlay .newRevCard {
        background-color: #404040 !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
    }
    
    .modal-overlay .newRevCard:hover {
        /* background-color: #404040 !important; */
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
    }
    
    /* Bright gray quote icon */
    #quote-icon,
    .modal-overlay #modal-quote-icon {
        opacity: 1;
        /* filter: brightness(10) contrast(0.8); */
    }
}


/* Theme Toggle Switch Styles */
.theme-toggle-container {
    position: fixed;
    top: 70px;
    right: 10px;
    z-index: 1001;
}

.theme-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.theme-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.theme-btn.active {
    background: var(--LogoColour);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(246, 49, 140, 0.3);
}

/* Dark mode toggle styles */
@media (prefers-color-scheme: dark) {
    .theme-toggle {
        background: rgba(45, 45, 45, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Force light theme */
html.theme-light {
    color-scheme: light !important;
}

html.theme-light body {
    background: linear-gradient(180deg, #eef0f3 0%, #dfe4ea 100%) !important;
}

html.theme-light .newRevCard {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

html.theme-light #newHeading {
    color: var(--HeaderColour) !important;
    text-shadow: 2px 10px 7px rgba(0, 0, 0, 0.2) !important;
}

html.theme-light .review-text {
    color: #393E46 !important;
}

html.theme-light .student-name {
    color: #333 !important;
}
html.theme-light .read-more-link {
    color: #007bff;
}
html.theme-light .student-initials
{
    background-color: #E6F0FF;
    color: var(--HeaderColour);
}

html.theme-light #quote-icon,
html.theme-light .modal-overlay #modal-quote-icon {
    opacity: 1;
    color: var(--HeaderColour);
    filter: none;
}

/* Light theme toggle background */
html.theme-light .theme-toggle {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}



/* Force dark theme */

html.theme-dark .theme-toggle {
    background: rgba(45, 45, 45, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
html.theme-dark body {
    background: linear-gradient(180deg, #1a1a1a 0%, #2c2c2c 100%) !important;
}

html.theme-dark #newHeading {
    color: #ffffff !important;
    text-shadow: 2px 10px 7px rgba(255, 255, 255, 0.1) !important;
}

html.theme-dark .newRevCard {
    background-color: #404040 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

html.theme-dark .review-text {
    color: #e0e0e0 !important;
}

html.theme-dark .student-name {
    color: #ffffff !important;
}

html.theme-dark #student-info {
    color: #b0b0b0 !important;
}

html.theme-dark .student-details {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html.theme-dark .student-initials {
    background-color: #555555 !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

html.theme-dark .student-image {
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

html.theme-dark .result-link {
    font-size: 14px;
    font-family: 'Poppins','Montserrat', sans-serif;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(90deg, #00e5ff, #ff4081, #00e5ff);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientSlide 3s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

html.theme-dark .result-link:hover {
    text-decoration: underline;
    animation-play-state: paused; /* Pause on hover for clarity */
    opacity: 1;
}

@keyframes gradientSlide {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}


html.theme-dark #quote-icon,
html.theme-dark .modal-overlay #modal-quote-icon {
    opacity: 1 !important;
    color: #D6DAC8 !important;
    filter: brightness(2) contrast(0.8) !important;
}

/* Mobile responsive toggle */
@media (max-width: 576px) {
    .theme-toggle-container {
        top: 170px;
        right: 10px;
    }
    
    .theme-btn {
        padding: 6px 8px;
        font-size: 14px;
    }
}