/* RC Racing Central - Main Stylesheet */
/* Colors inspired by the racing cars: white, bright orange, bright red, dark gray/black */

:root {
    /* Primary Colors from the racing cars */
    --primary-orange: #FF6B35;
    --primary-red: #FF3600;
    --primary-white: #FFFFFF;
    --primary-gray: #2D3748;
    --primary-black: #1A202C;
    
    /* Secondary Colors */
    --secondary-gray: #4A5568;
    --light-gray: #E2E8F0;
    --accent-yellow: #FFD700;
    
    /* Color aliases for calendar */
    --color-primary: var(--primary-orange);
    --color-accent: var(--primary-red);
    --color-dark: var(--primary-black);
    --color-text-secondary: var(--secondary-gray);
    
    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-display: 'Orbitron', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--primary-black);
    background-color: var(--primary-white);
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--primary-gray) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: var(--spacing-sm) 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-white);
    font-family: var(--font-display);
    gap: var(--spacing-sm);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-main {
    color: var(--primary-orange);
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: 0.3em;
}

.logo-subtitle {
    color: var(--primary-white);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1;
    margin-top: 2px;
    opacity: 0.9;
}

.logo-number {
    background: var(--primary-orange);
    color: var(--primary-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.2rem;
    font-family: var(--font-display);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--primary-white);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-orange);
    color: var(--primary-white);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-orange);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Welcome user styling */
.welcome-user {
    margin-right: var(--spacing-sm);
    display: flex;
    align-items: center;
}

.welcome-text {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-display);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 107, 53, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    white-space: nowrap;
}

.subscription-status {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 3px;
    text-align: center;
    font-family: var(--font-primary);
}

.subscription-status.status-trial {
    background: var(--primary-orange);
    color: white;
}

.subscription-status.status-active {
    background: #28a745;
    color: white;
}

.subscription-status.status-canceled {
    background: var(--primary-red);
    color: white;
}

.subscription-status.status-expired,
.subscription-status.status-none {
    background: #6c757d;
    color: white;
}

.subscription-status.status-admin {
    background: #6f42c1;
    color: white;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-white);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%236B7280" width="1200" height="600"/><path fill="%234B5563" d="M0,300 Q300,200 600,300 T1200,300 L1200,600 L0,600 Z"/></svg>');
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--primary-white);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: var(--spacing-xl);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero .highlight {
    color: var(--primary-orange);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    font-weight: 300;
}

.tagline {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.tagline-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--accent-yellow);
    border-radius: 25px;
    background: rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(10px);
    display: inline-block;
    animation: taglineGlow 2s ease-in-out infinite alternate;
}

@keyframes taglineGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-orange);
    color: var(--primary-white);
}

.btn-primary:hover {
    background-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.4);
    color: var(--primary-white);
    border: 2px solid var(--primary-white);
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: var(--primary-white);
    color: var(--primary-black);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

/* Secondary button on light backgrounds */
.light-section .btn-secondary {
    background-color: var(--light-gray);
    color: var(--primary-gray);
    border: 2px solid var(--primary-gray);
}

.light-section .btn-secondary:hover {
    background-color: var(--primary-gray);
    color: var(--primary-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Racing Cars Showcase Section */
.cars-showcase {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(135deg, var(--primary-white) 0%, var(--light-gray) 100%);
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xxl);
    margin-top: var(--spacing-xl);
}

.car-card {
    background: var(--primary-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.car-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.car-image {
    position: relative;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
}

.car-photo {
    width: 90%;
    height: 90%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.car-card:hover .car-photo {
    transform: scale(1.05);
}

.car-info {
    padding: var(--spacing-xl);
}

.car-info h3 {
    font-family: var(--font-display);
    color: var(--primary-gray);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-xs);
}

.car-info p {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
}

.car-specs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.spec-item {
    background: var(--primary-orange);
    color: var(--primary-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Features Section */
.features {
    padding: var(--spacing-xxl) 0;
    background-color: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--primary-gray);
    margin-bottom: var(--spacing-sm);
}

.section-title p {
    font-size: 1.2rem;
    color: var(--secondary-gray);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.feature-card {
    background: var(--primary-white);
    padding: var(--spacing-xl);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    font-size: 2rem;
    color: var(--primary-white);
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-gray);
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    color: var(--secondary-gray);
    line-height: 1.6;
}

/* Footer */
.main-footer {
    background-color: var(--primary-black);
    color: var(--primary-white);
    padding: var(--spacing-xxl) 0 var(--spacing-lg);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    color: var(--primary-orange);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.footer-section h4 {
    color: var(--primary-orange);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-display);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-section a {
    color: var(--primary-white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-orange);
}

.footer-bottom {
    border-top: 1px solid var(--primary-gray);
    padding-top: var(--spacing-md);
    text-align: center;
    color: var(--secondary-gray);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-black);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: var(--spacing-lg) 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }
    
    .tagline-text {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .car-image {
        height: 250px;
    }
    
    .car-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .tagline-text {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        letter-spacing: 0.05em;
    }

    .nav-container {
        padding: 0 var(--spacing-sm);
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* Calendar Styles */
.calendar-section {
    padding: 4rem 0;
}

.calendar-header {
    text-align: center;
    margin-bottom: 3rem;
}

.calendar-header h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.calendar-header p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

.calendar-month {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.month-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.month-header h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.1em;
}

.calendar-grid {
    padding: 0;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--color-dark);
    color: white;
}

.day-header {
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e5e7eb;
}

.calendar-week:last-child {
    border-bottom: none;
}

.calendar-day {
    min-height: 120px;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-day.empty {
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.day-number {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.calendar-day.today {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(229, 62, 62, 0.1) 100%);
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    position: relative;
}

.calendar-day.today .day-number {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.event-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    width: 100%;
    text-align: center;
    line-height: 1.2;
}

/* Event Type Colors */
.event-item.carpet-oval {
    background: var(--color-primary);
}

.event-item.road-course {
    background: var(--color-accent);
}

.event-item.slot-car {
    background: #10b981;
}

.event-item.irc-legends {
    background: #8b5cf6;
}

.event-item.losi-nascar {
    background: #f59e0b;
}

.event-item.dirt-offroad {
    background: #92400e;
}

.event-item.money-race {
    background: #dc2626;
    font-weight: 700;
}

.event-item.closed {
    background: #6b7280;
}

/* Event Legend */
.event-legend {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.event-legend h4 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-dark);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.carpet-oval {
    background: var(--color-primary);
}

.legend-color.road-course {
    background: var(--color-accent);
}

.legend-color.slot-car {
    background: #10b981;
}

.legend-color.irc-legends {
    background: #8b5cf6;
}

.legend-color.losi-nascar {
    background: #f59e0b;
}

.legend-color.dirt-offroad {
    background: #92400e;
}

.legend-color.money-race {
    background: #dc2626;
}

.legend-color.closed {
    background: #6b7280;
}

/* Responsive Calendar */
@media (max-width: 1024px) {
    .calendar-section {
        padding: 3rem 0;
    }
    
    .calendar-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .event-legend {
        position: static;
        order: -1;
        padding: 1.5rem;
    }
    
    .legend-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .legend-item {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .calendar-section {
        padding: 2rem 0;
    }
    
    .calendar-header {
        margin-bottom: 2rem;
    }
    
    .calendar-header h2 {
        font-size: 2rem;
    }
    
    .calendar-header p {
        font-size: 1rem;
    }
    
    .month-header h3 {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .calendar-day {
        min-height: 90px;
        padding: 0.5rem 0.25rem;
    }
    
    .day-number {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .event-item {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
        margin: 0.1rem 0;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    .event-legend h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .calendar-section {
        padding: 1.5rem 0;
    }
    
    .calendar-header h2 {
        font-size: 1.75rem;
    }
    
    .calendar-header p {
        font-size: 0.9rem;
    }
    
    .month-header {
        padding: 1rem;
    }
    
    .month-header h3 {
        font-size: 1.3rem;
    }
    
    .day-header {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .calendar-day {
        min-height: 75px;
        padding: 0.4rem 0.15rem;
    }
    
    .day-number {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .event-item {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
        margin: 0.05rem 0;
        line-height: 1.1;
    }
    
    .calendar-day.today .day-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .event-legend {
        padding: 1rem;
    }
    
    .event-legend h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .legend-item {
        font-size: 0.75rem;
        gap: 0.4rem;
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
    }
}

/* Track Location Section */
.track-location-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
}

.location-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.location-header h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.location-header p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

.location-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}

.address-info {
    display: flex;
    justify-content: center;
}

.address-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.address-card h4 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.address-details p {
    margin-bottom: 0.5rem;
    color: var(--color-dark);
    line-height: 1.5;
}

.address-details p:first-of-type {
    margin-top: 0;
}

.contact-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.location-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.location-actions .btn {
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.location-actions .btn-primary {
    background: var(--color-primary);
    color: white;
}

.location-actions .btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.location-actions .btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.location-actions .btn-secondary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.map-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.map-container iframe {
    display: block;
}

/* Responsive Location Section */
@media (max-width: 1024px) {
    .track-location-section {
        margin-top: 3rem;
        padding-top: 2rem;
    }
    
    .location-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .address-info {
        order: 2;
    }
    
    .map-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    .track-location-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .location-header {
        margin-bottom: 2rem;
    }
    
    .location-header h3 {
        font-size: 1.75rem;
    }
    
    .location-header p {
        font-size: 1rem;
    }
    
    .address-card {
        padding: 1.5rem;
    }
    
    .address-card h4 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .address-details p {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .location-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .location-actions .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }
    
    .map-container iframe {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .track-location-section {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .location-header h3 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .location-header p {
        font-size: 0.9rem;
    }
    
    .address-card {
        padding: 1.25rem;
    }
    
    .address-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .address-details p {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .contact-link {
        font-size: 0.85rem;
    }
    
    .location-actions .btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .map-container iframe {
        height: 300px;
    }
}

/* Admin Panel Styles */
.admin-section {
    padding: 2rem 0;
    min-height: 80vh;
}

.admin-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.admin-header p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
}

.admin-message {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.admin-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admin-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.users-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
    background: var(--color-dark);
    color: white;
    font-weight: 600;
    font-family: var(--font-display);
}

.admin-table tr:hover {
    background: #f9fafb;
}

.admin-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-badge.admin-yes {
    background: #dc2626;
    color: white;
}

.admin-badge.admin-no {
    background: #6b7280;
    color: white;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: var(--color-primary);
    color: white;
}

.btn-edit:hover {
    background: var(--color-accent);
    transform: translateY(-1px);
}

.btn-delete {
    background: #dc2626;
    color: white;
}

.btn-delete:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--color-primary);
}

.modal-body {
    padding: 1.5rem;
}

.warning-text {
    color: #dc2626;
    font-weight: 500;
    margin-top: 1rem;
}

#editForm {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .admin-section {
        padding: 1.5rem 0;
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .admin-header h1 {
        font-size: 2rem;
    }
    
    .admin-header p {
        font-size: 1rem;
    }
    
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
    
    .stat-card p {
        font-size: 0.9rem;
    }
    
    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .admin-table {
        min-width: 700px;
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2),
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn-edit,
    .btn-delete {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    #editForm {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .admin-section {
        padding: 1rem 0;
    }
    
    .admin-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .admin-header p {
        font-size: 0.9rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card h3 {
        font-size: 1.75rem;
    }
    
    .stat-card p {
        font-size: 0.85rem;
    }
    
    .admin-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .admin-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .btn-edit,
    .btn-delete {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 98%;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-actions .btn {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Setups Page Layout */
.setup-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.saved-setups-column {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

.setup-form-column {
    min-width: 0; /* Prevents grid overflow */
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    /* Target iOS Safari specifically */
    .setup-layout {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
    }
    
    .saved-setups-column {
        -webkit-flex: 0 0 350px;
        flex: 0 0 350px;
    }
    
    .setup-form-column {
        -webkit-flex: 1;
        flex: 1;
        min-width: 0;
    }
}

/* Setups Page Responsive */
@media (max-width: 1024px) {
    .setup-layout {
        grid-template-columns: 300px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .setup-layout {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -webkit-flex-direction: column !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        gap: 0;
        grid-template-columns: unset !important;
    }
    
    .saved-setups-column {
        position: static !important;
        position: -webkit-static !important;
        -webkit-box-ordinal-group: 0 !important;
        -webkit-order: -1 !important;
        -ms-flex-order: -1 !important;
        order: -1 !important;
        margin-bottom: 2rem;
        max-height: none !important;
        width: 100% !important;
        overflow-y: visible !important;
        -webkit-flex: 0 0 auto !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
    
    .setup-form-column {
        -webkit-box-ordinal-group: 2 !important;
        -webkit-order: 1 !important;
        -ms-flex-order: 1 !important;
        order: 1 !important;
        width: 100% !important;
        -webkit-flex: 0 0 auto !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 480px) {
    .setup-layout {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -webkit-flex-direction: column !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
    }
    
    .saved-setups-column {
        position: static !important;
        position: -webkit-static !important;
        -webkit-box-ordinal-group: 0 !important;
        -webkit-order: -1 !important;
        -ms-flex-order: -1 !important;
        order: -1 !important;
        margin-bottom: 1.5rem;
        width: 100% !important;
        max-height: none !important;
        -webkit-flex: 0 0 auto !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
    
    .setup-form-column {
        -webkit-box-ordinal-group: 2 !important;
        -webkit-order: 1 !important;
        -ms-flex-order: 1 !important;
        order: 1 !important;
        width: 100% !important;
        -webkit-flex: 0 0 auto !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
}

/* Admin Link Styling */
.admin-link {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-red) 100%);
    color: white !important;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-orange) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ======================================== */

/* Contact Page Mobile */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        order: 2;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-form-container {
        order: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 2rem 0;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .contact-card {
        padding: 1.25rem;
    }
    
    .contact-icon {
        font-size: 2rem;
    }
    
    .contact-form {
        padding: 1.25rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .btn-full {
        padding: 0.875rem;
        font-size: 1rem;
    }
}

/* Login & Signup Pages Mobile */
@media (max-width: 768px) {
    .auth-container {
        max-width: 90%;
        margin: 2rem auto;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .auth-form .form-group label {
        font-size: 0.9rem;
    }
    
    .auth-form input {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .auth-form .btn {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    .auth-links {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Cars Page Mobile */
@media (max-width: 768px) {
    .upload-form-container {
        padding: 1.5rem;
    }
    
    .cars-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .cars-section {
        padding: 2rem 0;
    }
    
    .upload-form-container {
        padding: 1.25rem;
    }
    
    .upload-form .form-group label {
        font-size: 0.9rem;
    }
    
    .upload-form input,
    .upload-form select,
    .upload-form textarea {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .cars-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .car-card {
        padding: 1rem;
    }
    
    .car-info h3 {
        font-size: 1.1rem;
    }
    
    .car-info p {
        font-size: 0.85rem;
    }
}

/* Setups Form Mobile - Enhanced */
@media (max-width: 768px) {
    .setup-form-container {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .form-section h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .saved-setups-column {
        padding: 1rem;
    }
    
    .setups-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .setups-table {
        font-size: 0.85rem;
    }
    
    .setups-table th,
    .setups-table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .setups-section {
        padding: 1.5rem 0;
    }
    
    .section-title h2 {
        font-size: 1.75rem;
    }
    
    .setup-form-container {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .form-section h3 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
        padding: 0.875rem;
    }
    
    .saved-setups-column {
        padding: 0.75rem;
    }
    
    .saved-setups-header h3 {
        font-size: 1.3rem;
    }
    
    .setups-table {
        font-size: 0.75rem;
    }
    
    .btn-small {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}

/* General Mobile Improvements */
@media (max-width: 768px) {
    /* Typography adjustments */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* Container and spacing */
    .container {
        padding: 0 1.5rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        min-width: auto;
    }
    
    /* Hero sections */
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 4rem 0 2rem;
    }
    
    /* CTA buttons */
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Feature cards */
    .features {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    /* Typography for small phones */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Container and spacing */
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    /* Hero sections */
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .hero-section {
        padding: 3rem 0 1.5rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Tables - horizontal scroll */
    table {
        font-size: 0.85rem;
    }
    
    /* Forms - touch-friendly */
    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* iOS-specific input fixes */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    textarea,
    select {
        -webkit-border-radius: 4px;
        border-radius: 4px;
    }
    
    /* Prevent iOS zoom on focus */
    @supports (-webkit-touch-callout: none) {
        input,
        select,
        textarea {
            font-size: 16px !important;
        }
    }
    
    /* Feature cards */
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.2rem;
    }
    
    .feature-card p {
        font-size: 0.9rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets for touch devices */
    .btn,
    .nav-link,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .feature-card:hover {
        transform: none;
    }
    
    /* Better touch scrolling */
    .setups-table-container,
    .users-table-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Setup View Modal */
.setup-view-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.setup-view-modal-content {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    margin: 2% auto;
    padding: 0;
    border: 2px solid var(--primary-orange);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-view-modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-red) 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setup-view-modal-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: white;
}

.setup-view-close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.setup-view-close:hover,
.setup-view-close:focus {
    color: var(--accent-yellow);
    transform: rotate(90deg);
}

.setup-view-modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.setup-view-content {
    color: white;
}

.setup-view-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.setup-view-section:last-child {
    margin-bottom: 0;
}

.setup-view-section h3 {
    color: var(--primary-orange);
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-orange);
}

.setup-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.setup-view-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary-orange);
    border-radius: 4px;
    line-height: 1.6;
}

.setup-view-item.full-width {
    grid-column: 1 / -1;
    border-left-width: 4px;
}

.setup-view-item strong {
    color: var(--accent-yellow);
    display: inline-block;
    margin-right: 0.5rem;
    font-weight: 600;
}

/* Mobile responsive for setup view modal */
@media (max-width: 768px) {
    .setup-view-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .setup-view-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .setup-view-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .setup-view-modal-body {
        padding: 1.5rem;
        max-height: 75vh;
    }
    
    .setup-view-section {
        padding: 1rem;
    }
    
    .setup-view-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .setup-view-item {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .setup-view-modal-content {
        width: 98%;
        margin: 2% auto;
    }
    
    .setup-view-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .setup-view-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .setup-view-close {
        font-size: 28px;
    }
    
    .setup-view-modal-body {
        padding: 1rem;
        max-height: 80vh;
        -webkit-overflow-scrolling: touch;
    }
    
    .setup-view-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .setup-view-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .setup-view-item {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .setup-view-item strong {
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* iOS-specific fixes for all pages */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS Safari grid issues */
    body {
        -webkit-text-size-adjust: 100%;
    }
    
    /* Prevent rubber band scrolling on body */
    body {
        position: relative;
        overflow-x: hidden;
    }
    
    /* Fix sticky positioning on iOS */
    .saved-setups-column {
        position: -webkit-sticky;
        position: sticky;
    }
    
    /* Fix modal positioning on iOS */
    .setup-view-modal {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix viewport height issues on iOS */
    .setup-view-modal-body {
        max-height: 80vh;
        max-height: calc(var(--vh, 1vh) * 80);
    }
}

/* iPhone 15 Pro specific (393px width) */
@media (max-width: 430px) {
    .setup-layout {
        display: -webkit-box !important;
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-flex-direction: column !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    .container {
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .setups-section {
        padding: 1.5rem 0;
        overflow-x: hidden;
    }
    
    .saved-setups-column,
    .setup-form-column {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        -webkit-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
    
    .saved-setups-column {
        -webkit-box-ordinal-group: 0 !important;
        -webkit-order: -1 !important;
        order: -1 !important;
    }
    
    .setup-form-column {
        -webkit-box-ordinal-group: 2 !important;
        -webkit-order: 1 !important;
        order: 1 !important;
    }
    
    /* Fix table overflow on iPhone */
    .setups-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
    }
    
    .setups-table {
        width: 100%;
        min-width: 600px;
    }
}

/* Chrome on iOS specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-width: 768px) {
    .setup-layout {
        display: block !important;
    }
    
    .saved-setups-column {
        display: block !important;
        float: none !important;
        margin-bottom: 2rem;
        width: 100% !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .setup-form-column {
        display: block !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        position: relative !important;
        z-index: 0 !important;
    }
}

/* Force Chrome to respect source order */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (max-width: 768px) {
    .setups-section .container {
        display: block !important;
    }
    
    .setups-section .container > * {
        display: block !important;
        width: 100% !important;
        margin-bottom: 2rem !important;
    }
    
    .setups-section .container > *:last-child {
        margin-bottom: 0 !important;
    }
}

/* Ultimate Chrome iOS fix - force source order */
@supports (-webkit-appearance: none) {
    @media (max-width: 768px) {
        .setup-layout {
            display: block !important;
            position: relative !important;
        }
        
        .saved-setups-column {
            position: relative !important;
            z-index: 10 !important;
            display: block !important;
            width: 100% !important;
            margin-bottom: 2rem !important;
            float: none !important;
            clear: both !important;
        }
        
        .setup-form-column {
            position: relative !important;
            z-index: 5 !important;
            display: block !important;
            width: 100% !important;
            float: none !important;
            clear: both !important;
        }
    }
}
