/* Modern, clean CSS for responsive design */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&display=swap');

/* Base responsive design with mobile-first approach */
* {
    box-sizing: border-box;
}

/* Arboria isn't on Google Fonts; use a local stack with Arboria if available, otherwise fall back to a clean sans */
body {
    font-family: 'Arboria', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    font-size: 16px; /* Base font size for good mobile readability */
}

header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    min-height: 120px; /* Reduced for better mobile display */
    flex-wrap: wrap;
}

/* Enhanced candidate header design */
.candidate-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    min-height: 160px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 50%, #004494 100%);
    overflow: hidden;
}

/* Add animated background elements */
.candidate-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(255, 235, 59, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 30%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(180deg); }
}

.candidate-header .nav-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    color: white;
    text-decoration: none;
    font-weight: bold;
    background: rgba(255, 235, 59, 0.2);
    border: 2px solid rgba(255, 235, 59, 0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.candidate-header .nav-link:hover {
    background: rgba(255, 235, 59, 0.9);
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 235, 59, 0.3);
}

.candidate-header .centered-image {
    max-height: 80px;
    flex: 1;
    object-fit: contain;
    border: 2px solid white;
    box-sizing: border-box;
}

.candidate-header .header-content {
    flex-shrink: 0;
    text-align: right;
}

header img {
    display: block;
    margin: 0 auto 1rem;
    border: 3px solid white;
}

.logo {
    width: 240px; /* Smaller default size for better mobile fit */
    height: auto;
    fill: white;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    max-width: calc(100vw - 2rem); /* Prevent logo from overflowing on small screens */
}

.logo-link:hover {
    background-color: transparent !important;
}

.header-content {
    flex: 1;
    text-align: center;
    margin-left: 0; /* left column occupies space naturally */
}

/* Name section: place photo and name on the same row and vertically center them */
.name-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

.name-section h1 {
    margin: 0;
    text-align: left; /* keep name left-aligned relative to itself */
    font-size: clamp(1.2rem, 4vw, 2rem); /* Responsive font size */
}

/* Candidate page: small photo and action area on the right of the header */
/* Left column for logo + candidate photo (candidate pages) */
.left-column {
    /* place the left column in the header flow so its contents remain inside the top bar */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 1;
    width: 260px; /* fixed column width so header-content centers properly */
    padding-left: 1rem;
    padding-right: 1rem;
}

/* When a candidate page uses the left-column, make the logo flow naturally inside it */
.left-column .logo {
    position: static;
    width: 200px; /* smaller so candidate photo fits nicely below */
    margin-bottom: 0.25rem;
}

.candidate-photo {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-height: 220px; /* limit height so both image and button fit */
}

.candidate-photo img {
    /* fall back styling for pages that don't use the framed layout */
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Enhanced photo frame with modern styling */
.photo-frame {
    width: clamp(140px, 25vw, 220px);
    height: clamp(140px, 25vw, 220px);
    background: linear-gradient(145deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    box-sizing: border-box;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 2px 8px rgba(255, 255, 255, 0.1);
    position: relative;
}

.photo-frame::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffeb3b, #007bff, #ffeb3b);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.photo-frame:hover img {
    transform: scale(1.05);
}

/* Override max-height for images inside photo-frame */
.photo-frame .centered-image {
    max-height: none;
    height: 100%;
    width: 100%;
}

.candidate-photo .nav-link {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.45rem 0.8rem;
}

/* Image modal / lightbox */
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    padding: 0; /* we'll handle spacing inside the modal-content to guarantee containment */
}

.image-modal.open {
    display: flex;
}

.image-modal .modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ensure content always stays inside the viewport with a small margin */
    box-sizing: border-box;
    padding: 12px; /* comfortable inner padding without pushing image off-screen */
    max-width: calc(100vw - 32px);
    /* Limit modal to 90% of viewport height to avoid oversized modals */
    max-height: calc(90vh - 32px);
    background: transparent; /* keep backdrop visible */
    transform-origin: center center;
    transition: opacity 180ms ease, transform 180ms ease;
    opacity: 0;
    transform: scale(0.96);
}

.image-modal img {
    display: block;
    max-width: 100%;
    /* ensure image never exceeds 90% of viewport height */
    max-height: calc(90vh - 32px);
    width: auto;
    height: auto;
    object-fit: contain; /* ensure full image is visible without cropping */
    border-radius: 6px;
}

.image-modal .close-btn {
    position: absolute;
    /* place the close button inside the modal content so it doesn't push the image out */
    top: 8px;
    right: 8px;
    background: #fff;
    color: #333;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2; /* keep it above the image */
}

/* If the modal contains large images, ensure the image is never positioned outside the visible area
   by forcing the modal-content to use constrained dimensions and centering */
.image-modal.open .modal-content {
    /* same constraints when open (helps some older browsers/layout engines) */
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    opacity: 1;
    transform: scale(1);
}

/* Header text: use an elegant serif for a city look */
.header-content h1,
.header-content p {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Responsive typography */
    font-weight: 300;
}

/* Main content responsive padding with modern design */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 123, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Add a subtle pattern overlay */
main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(0, 123, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 235, 59, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

main > * {
    position: relative;
    z-index: 1;
}

section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 123, 255, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Enhanced section hover effects */
section:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(0, 123, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Responsive typography with better styling */
h2 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    color: #007bff;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

/* Add decorative underline to h2 */
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #ffeb3b);
    border-radius: 2px;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
    color: #0056b3;
    font-weight: 500;
}

/* Enhanced list styling */
ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    border-left: 4px solid #007bff;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
}

ul li:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

/* Special styling for key sections */
#profile section:first-child {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05), rgba(255, 235, 59, 0.05));
    border-left: 5px solid #007bff;
}

/* Summary section gets special treatment */
section h2:first-of-type {
    color: #007bff;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    text-align: center;
    margin-bottom: 2rem;
}

section h2:first-of-type::after {
    width: 100px;
    left: 50%;
    transform: translateX(-50%);
}

/* Policy Perspectives special styling */
section:has(h2:contains("Policy Perspectives")) ul li,
section h2:contains("Policy Perspectives") + ul li {
    border-left-color: #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05), rgba(255, 255, 255, 0.6));
}

/* Strengths section special styling */
section:has(h2:contains("Strengths")) ul li,
section h2:contains("Strengths") + ul li {
    border-left-color: #ffc107;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.05), rgba(255, 255, 255, 0.6));
}

/* Highlights section special styling */
section:has(h2:contains("Highlights")) ul li,
section h2:contains("Highlights") + ul li {
    border-left-color: #17a2b8;
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.05), rgba(255, 255, 255, 0.6));
}

/* Enhance paragraph text */
p {
    line-height: 1.7;
    color: #333;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Add subtle text shadows for better readability */
h1, h2, h3 {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Contact Information section gets special card treatment */
#contact {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    color: white;
}

#contact h2 {
    color: white;
}

#contact h2::after {
    background: linear-gradient(90deg, #ffeb3b, white);
}

#contact ul li {
    background: rgba(255, 255, 255, 0.2) !important;
    border-left-color: #ffeb3b;
    color: white;
    backdrop-filter: blur(5px);
}

#contact ul li:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Enhanced typography and spacing */
header p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

/* Add smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhance the chart container */
.chart-wrap-hidden {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.1);
}

/* Add a subtle animation to sections when they come into view */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: slideInUp 0.6s ease-out;
}

/* Stagger the animation for multiple sections */
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }

/* Header link styling should only affect navigation buttons, not the logo */
.nav-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.75rem 1.5rem; /* Larger touch targets for mobile */
    border: 2px solid #ffeb3b;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
    min-height: 44px; /* iOS recommended minimum touch target */
    box-sizing: border-box;
    text-align: center;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #ffeb3b;
    color: #007bff;
    outline: none;
    transform: translateY(-1px);
}

/* Ensure the SVG logo anchor doesn't get the nav hover/focus styles */
.logo-link {
    display: inline-block; /* shrink-wrap to the SVG */
    padding: 0; /* no extra hit area unless desired */
    border: none;
    background: transparent;
}

.logo-link:hover,
.logo-link:focus,
.logo-link:active {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Make the anchor cover the exact SVG area so there isn't an empty highlighted box */
.logo-link .logo {
    display: block;
    pointer-events: none; /* allow the anchor to receive clicks, not the inner SVG */
}

main {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

section {
    background: white;
    margin: 1rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h2 {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

ul {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

ol {
    list-style-position: outside;
    padding-left: 2rem;
}

li {
    margin: 0.5rem 0;
    list-style-type: "•";
    list-style-position: outside;
    padding-left: 0.5rem;
}

/* Restore box styling for rankings on index page */
#rankings li {
    background: white;
    margin: 1rem 0;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    list-style-type: none;
    padding-left: 0;
}

li a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

#rankings li a:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

#rankings li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

footer {
    text-align: center;
    padding: 1rem;
    background: #333;
    color: white;
    margin-top: 2rem;
}

footer a {
    color: #ffeb3b;
}

footer a:hover {
    color: #fff;
}

/* Responsive design - Mobile First Approach */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        min-height: 100px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo {
        position: static;
        width: 180px;
        margin-bottom: 0.5rem;
    }

    .header-content {
        margin-left: 0;
        width: 100%;
    }

    h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    main {
        padding: 0 0.5rem;
        margin: 0.5rem auto;
    }

    section {
        padding: 1rem;
        margin: 0.5rem 0;
    }

    /* Better mobile list styling */
    #rankings li a > div {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        align-items: center;
    }

    #rankings li a > div img {
        width: 100px;
        height: 100px;
    }

    #rankings li a > div > div:nth-child(2) {
        min-width: auto;
        text-align: center;
    }

    /* Mobile-friendly tables */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    header {
        padding: 0.75rem;
        min-height: 80px;
    }

    .logo {
        width: 140px;
    }

    h1 {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .name-section {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .name-section h1 {
        font-size: clamp(1.1rem, 4vw, 1.4rem);
        text-align: center;
    }

    main {
        padding: 0 0.25rem;
        margin: 0.25rem auto;
    }

    section {
        padding: 0.75rem;
        margin: 0.25rem 0;
    }

    /* Ultra-compact mobile list styling */
    #rankings li a {
        padding: 0.75rem;
    }

    #rankings li a > div {
        gap: 0.5rem;
    }

    #rankings li a > div img {
        width: 80px;
        height: 80px;
    }

    #rankings li a > div > div:last-child {
        font-size: 1.2rem;
        padding: 0.4rem 0.8rem;
        min-width: 50px;
    }

    /* Ensure images on individual pages are responsive */
    header img,
    .photo-frame {
        width: clamp(80px, 20vw, 120px);
        height: clamp(80px, 20vw, 120px);
    }

    /* Make charts responsive */
    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Improve text readability on small screens */
    p, li {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Better spacing for details/summary on mobile */
    details summary {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
    
    details p {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .logo {
        width: 150px;
    }

    .header-content {
        margin-left: 170px;
    }

    h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.75rem;
    }

    .logo {
        width: 100px;
        top: 0.5rem;
        left: 0.5rem;
    }

    .header-content {
        margin-left: 120px;
    }

    h1 {
        font-size: 1.2rem;
    }

    header p {
        font-size: 0.9rem;
    }

    main {
        padding: 0 0.25rem;
    }

    section {
        padding: 0.75rem;
    }

    li a {
        padding: 0.5rem;
    }

    li a div {
        gap: 8px;
    }

    li a div img {
        width: 80px;
        height: 80px;
    }

    /* Ensure images on individual pages are responsive */
    header img {
        max-width: 100%;
        height: auto;
        width: 150px;
    }

    /* Make charts responsive */
    canvas {
        max-width: 100%;
        height: auto !important;
    }

    /* Improve text readability on small screens */
    body {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Better button/link spacing on mobile */
    a {
        display: inline-block;
        margin: 0.25rem 0;
    }

    /* Index page header mobile improvements */
    .logo-link {
        position: static;
        display: block;
        text-align: center;
        margin-bottom: 1rem;
    }

    .logo {
        position: static;
        width: 200px;
        margin: 0 auto;
    }

    .header-content {
        margin-left: 0;
        text-align: center;
    }
}

/* Mobile responsive rules for candidate headers */
@media (max-width: 768px) {
    .candidate-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        min-height: auto;
    }
    
    .candidate-header .nav-link {
        position: static;
        align-self: flex-start;
        margin-bottom: 1rem;
    }
    
    .candidate-header .header-content {
        text-align: center;
        flex-shrink: 1;
    }
    
    .name-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .name-section h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .candidate-header .centered-image {
        max-height: 100px;
        max-width: 100px;
    }
    
    .photo-frame .centered-image {
        max-height: none;
        max-width: none;
        height: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .candidate-header {
        padding: 0.75rem;
    }
    
    .candidate-header .nav-link {
        font-size: 0.9rem;
    }
    
    .name-section h1 {
        font-size: 1.2rem;
    }
    
    .candidate-header .centered-image {
        max-height: 80px;
        max-width: 80px;
    }
    
    .photo-frame .centered-image {
        max-height: none;
        max-width: none;
        height: 100%;
        width: 100%;
    }
}

/* Enhanced expandable ratings styling */
details {
    margin: 1.5rem 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 250, 0.9));
    box-shadow: 
        0 4px 16px rgba(0, 123, 255, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

details:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 24px rgba(0, 123, 255, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08);
}

details summary {
    cursor: pointer;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px 12px 0 0;
    list-style: none;
    position: relative;
    transition: all 0.3s ease;
}

details summary:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-1px);
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: "▶";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    transition: transform 0.3s ease;
    color: #ffeb3b;
}

details[open] summary::after {
    transform: translateY(-50%) rotate(90deg);
}

details[open] summary {
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #28a745, #20c997);
}

details p {
    margin: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 12px 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    border-top: 2px solid rgba(0, 123, 255, 0.1);
}

/* Mobile improvements for expandable ratings */
@media (max-width: 480px) {
    details summary {
        padding: 1rem 0.75rem;
        font-size: 1rem;
    }
    
    details p {
        padding: 1rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Additional mobile enhancements */

/* Improve tap targets for all interactive elements */
@media (max-width: 768px) {
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent horizontal scrolling */
    body {
        overflow-x: hidden;
    }
    
    /* Make text more readable on mobile */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Improve form elements on mobile */
    input, textarea, select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
        border-radius: 4px;
        border: 1px solid #ddd;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link {
        border-width: 3px;
    }
    
    li a div img {
        border-width: 4px;
    }
}