:root {
  --delay: 1000ms;
  --duration: 800ms;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0 48px;
  background-color: #9db4ac;
  color: #ffffff;
  box-sizing: border-box;
}

body > * {
  opacity: 0;
  transition: opacity var(--duration) ease;
  transition-delay: var(--delay);
  width: 100%; /* Ensures children span the flex container */
}

body.start > * {
  opacity: 1;
}

* {
  font-family: arial;
  font-weight: 400;
  letter-spacing: -0.02em;
}

h1,
h2,
h3 {
  font-weight: 600;
}

h1 {
  font-size: 16px;
}

header,
footer {
  position: fixed;
  left: 0;
  width: 100%;
  box-sizing: border-box;
}

header {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  z-index: 100; /* Ensure header stays above content */
}

header .time {
  font-family: "Courier New", Courier, monospace;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.7);
}

footer #tip {
  margin-left: 48px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
}

footer {
  bottom: 0;
  padding-bottom: 24px;
}

svg {
  width: 100%;
}

textPath {
  font-size: 16px;
  fill: rgba(255, 255, 255, 0.8);
  letter-spacing: 28px;
}

#button-list {
  list-style: none;
  padding: 0 48px;
  display: flex;
  overflow: visible;
  max-width: 100%;
  align-items: flex-end;
  margin-bottom: 8px;
}

#button-list li {
  display: flex;
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}

#button-list li:last-child {
  border-right: none;
}

#button-list button {
  padding: 8px 24px;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  font-family: arial;
  font-size: 28px;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  outline: none;
  transition: all 0.2s ease;
}

@media (hover: hover) {
  #button-list button:hover {
    color: white;
    font-size: 38px;
    font-weight: bold;
  }
}

#button-list button:focus {
  color: white;
  font-size: 38px;
  font-weight: bold;
}

main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
}

.visual-wrapper {
    display: flex;
    gap: 2rem;
    width: 60%;
}

.car-drawing {
    width: 45%;
    color: #1b2f42;
}

.side-panel {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3rem;
}

.logo-placeholder {
    width: 160px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

.ratings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    align-items: flex-end;
}

.rating-row {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.indicator-bar {
    display: flex;
    gap: 4px;
}

.indicator-bar span {
    display: block;
    width: 16px;
    height: 12px;
}

.indicator-bar span.fill {
    background-color: #fff;
}

.indicator-bar span.empty {
    background-color: rgba(255, 255, 255, 0.3);
}

/* F1 View Specific Styles */
.f1-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vertical-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60vh;
}

.vertical-menu {
    display: flex;
    flex-direction: column;
    width: 50%;
    margin-left: 20%;
}

.vertical-menu .menu-item {
    font-size: 24px;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.vertical-menu .menu-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.vertical-menu .menu-item .arrow {
    background-color: transparent;
    color: transparent;
    font-weight: bold;
    border: 1px solid transparent;
    padding: 0 6px;
    font-size: 20px;
}

.vertical-menu .menu-item.active {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
}

.vertical-menu .menu-item.active .arrow {
    background-color: rgba(255, 255, 255, 0.8);
    color: #9db4ac;
    border: 1px solid #fff;
}

.flag-matrix {
    width: 420px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.horizontal-menu-footer ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    margin-bottom: 16px;
}

.horizontal-menu-footer ul li {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.horizontal-menu-footer ul li:last-child {
    border-right: none;
}

.horizontal-menu-footer ul li.active {
    font-size: 44px;
    font-weight: bold;
    color: #fff;
}

.horizontal-menu-footer ul li.inactive {
    color: rgba(255, 255, 255, 0.3);
}

.f1-view {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.f1-view.active {
    display: flex;
}

.gp-view {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 48px;
}

.gp-view-left {
    width: 55%;
}

#track-map {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.gp-view-right {
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.gp-view-right .flag-matrix {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0;
}

.gp-details {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.gp-details p {
    margin: 0 0 10px 0;
}


/* F1 Detail View Styles */
.detail-view {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 48px;
    height: 70vh;
    margin-top: 40px;
}
.detail-left {
    width: 45%;
}
.detail-right {
    width: 45%;
    display: flex;
    flex-direction: column;
}
.weather-map-box {
    background-color: #a3c4a8; /* light green from image */
    border: 1px solid rgba(0,0,0,0.5);
    padding: 2px;
    height: 350px;
    display: flex;
    flex-direction: column;
}
.weather-top {
    font-size: 14px;
    color: #333;
    padding: 4px;
}
.weather-map {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.weather-map .flag-matrix {
    width: 100%;
    height: 100%;
}
.weather-temp-bar {
    height: 24px;
    background: linear-gradient(to right, #9bbad3, #d9dfc2, #f3d57d, #ef9121);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #333;
}
.track-desc {
    margin-top: 4rem;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    line-height: 1.4;
}

.right-top-logos {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 32px;
}
.event-logo {
    background-color: #002255;
    color: #fff;
    padding: 8px 16px;
    font-weight: bold;
    border: 1px solid rgba(255,255,255,0.3);
}
.event-flag {
    width: 80px;
    height: 40px;
}

.stage-info p {
    margin: 4px 0;
    color: rgba(255,255,255,0.7);
    font-size: 15px;
}
.stage-info h2 {
    font-size: 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 4px;
}

/* Prediction Form */
.form-menu {
    margin-top: 4rem;
    width: 100%;
}
.form-menu .menu-item {
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding: 8px 0;
}
.form-menu .input-wrap {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}
.form-menu label {
    flex: 1;
    font-size: 18px;
    margin-left: 8px;
}
.form-menu input, .form-menu select {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16x;
    font-family: Arial;
    text-align: right;
    outline: none;
}
.form-menu input:focus, .form-menu select:focus {
    background: rgba(255,255,255,0.1);
}
.form-menu select option {
    background: #9db4ac;
    color: #9db4ac;
}

.submit-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    font-family: arial;
    cursor: pointer;
    text-align: left;
    width: 100%;
    margin-left: 8px;
}
.form-menu .menu-item.active {
    font-size: 20px;
}

/* Motiiw Page Specific Styles */
.page-template-page-motiiw main {
    justify-content: space-around;
    align-items: center;
}

.visual-wrapper {
    width: 60%;
    position: relative;
    height: 250px;
}

.car-drawing {
    position: absolute;
    width: 80%;
    color: rgba(255, 255, 255, 0.8);
}

.left-car {
    top: 0;
    left: 0;
}

.right-car {
    top: 20px;
    left: 40px;
    color: rgba(0, 0, 0, 0.6);
}

.side-panel {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.brand-badge {
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px;
}

.logo-placeholder {
    width: 180px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
}

.ratings {
    width: 100%;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.indicator-bar {
    display: flex;
}

.indicator-bar span {
    width: 20px;
    height: 10px;
    margin-left: 5px;
    background-color: rgba(255, 255, 255, 0.3);
}

.f1-prediction-wrapper {
    width: 100%;
    max-width: 960px;
    padding: 100px 0 100px 0; /* Clears fixed header/footer dynamically */
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.f1-prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

.f1-prediction-header h1 {
    font-size: 16px; 
    font-weight: 600;
    text-transform: none;
}

#f1-timer {
    font-family: "Courier New", Courier, monospace;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7); 
    letter-spacing: 0;
}

/* Main Wrapper - Stacked vertically */
.f1-prediction-main {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    gap: 13rem; /* Reduced from 6rem to bring the form into view */
    flex-grow: 1;
    width: 100%;
.f1-car-showcase {
  order: 1;
}

.f1-track-info {
  order: 2;
}

/* Track Info Container (Top) */
.f1-track-info {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: row; /* Keep image left, stats right on desktop */
    align-items: center;
    justify-content: space-between;
    gap: 10rem;
}

/* Prediction Form Container (Bottom) */
.f1-prediction-form-container {
    width: 100%;
    max-width: 720px;
}

.track-image {
    width: 100%;
}

.track-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.track-stats {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item .label {
    font-size: 14px;
    color: #d5e5de;
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 18px;
    font-weight: 400;
    color: #d5e5de;
}

.stat-item .holder {
    font-size: 14px;
    color: #d5e5de;
}

.f1-prediction-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.f1-prediction-form .form-row {
    display: flex;
    flex-direction: column; 
    justify-content: flex-start; 
    align-items: flex-start; 
    margin-bottom: 1.5rem; 
}

.f1-prediction-form label {
    font-size: 20px;
    font-weight: bold;
    color: #dfeee7; 
    text-transform: none; 
    letter-spacing: normal;
    margin-bottom: 8px; 
    flex: 1; 
}

.f1-prediction-form input,
.f1-prediction-form select,
.form-menu input,
.form-menu select {
    width: 100%;
    max-width: 800px; /* Adjust this value to your preferred maximum width */
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: #d2dcd8;
    font-size: 20px;
    font-weight: bold;
    outline: none;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left; 
    flex: 1; 
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3); 
}

.f1-prediction-form select option {
    background: #9db4ac;
    color: #9db4ac;
    border: none;
}


.f1-prediction-form input:focus,
.f1-prediction-form select:focus {
    background: rgba(255, 255, 255, 0.05);
}

.submit-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0;
    font-size: 20px; 
    font-weight: bold;
    cursor: pointer;
    text-transform: none; 
    letter-spacing: normal;
    outline: none;
    transition: all 0.2s ease;
    margin-top: 1.5rem; 
    text-align: right;
    padding-right: 20px; 
}

.submit-button::before {
    content: '>';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: transparent; 
    font-weight: bold;
    transition: color 0.2s ease;
}

.submit-button:hover,
.submit-button:focus {
    color: white;
    font-weight: bold; 
}

.submit-button:hover::before,
.submit-button:focus::before {
    color: white; 
}

#form-message {
    margin-top: 1.5rem;
    font-size: 16px;
    text-align: center;
}

/* New F1 Car and Sponsors sections - Moved above media queries */
.f1-car-showcase {
    gap: 1rem;
    width: 100%;
    text-align: left;
}

.f1-car-showcase img {
    max-width: 100%;
    height: auto;
}

.f1-sponsors-section {
    gap: 1rem;
    text-align: left;
    padding-bottom: 4rem;
}

.f1-sponsors-section .sponsors-heading {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 1.5rem;
}

.f1-sponsors-section .sponsors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 18px;
    line-height: 1.6;
    color: #fff;
    margin: 0;
    padding: 0;
}


/* ==========================================================================
   Responsive Design / Media Queries
   ========================================================================== */

/* Tablet & Mobile (Max 1024px) */
@media screen and (max-width: 1024px) {
    /* Global Adjustments */
    body {
        padding: 0 24px;
    }
    
    header {
        padding: 16px 24px;
    }
    
    footer {
        padding-bottom: 16px;
    }
    
    #button-list {
        padding: 0 24px;
    }

    footer #tip {
        margin-left: 24px;
        font-size: 12px;
    }

    /* Main layout elements - Removed .f1-prediction-wrapper to preserve 120px padding */
    main, .gp-view {
        padding: 0;
    }

    .visual-wrapper {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        align-items: center;
    }

    .ratings {
        align-items: center;
    }

    .rating-row {
        align-items: center;
    }

    /* F1 Detail View Adjustments */
    .detail-view {
        flex-direction: column;
        height: auto;
        gap: 2rem;
    }

    .detail-left, .detail-right {
        width: 100%;
    }

    .weather-map-box {
        height: 250px;
    }
}

/* Mobile Devices (Max 768px) */
@media screen and (max-width: 768px) {
    /* Global Elements */
    body {
        padding: 0 16px;
    }

    header {
        padding: 16px;
    }

    header .time {
        font-size: 14px;
    }

    header h1 {
        font-size: 14px;
    }

    #button-list {
        padding: 0 16px;
        touch-action: none;
    }

    #button-list button {
        font-size: 20px;
        padding: 6px 12px;
    }

    @media (hover: hover) {
        #button-list button:hover {
            font-size: 24px;
        }
    }

    #button-list button:focus {
        font-size: 24px;
    }

    footer #tip {
        margin-left: 16px;
    }

    /* F1 Prediction View */
   .f1-prediction-wrapper {
        padding: 80px 0 80px 0;
        gap: 3rem;
    }

    .f1-prediction-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .f1-prediction-main {
        gap: 3rem; /* Match wrapper gap */
    }

 /* Mobile overrides for the new form padding */
@media screen and (max-width: 768px) {
    .f1-track-info {
        flex-direction: column;
        gap: 2rem;
    }

    .f1-prediction-form-container {
        padding: 1.5rem; /* Tighter padding for mobile screens */
    }


    .track-image, .track-stats {
        width: 100%;
    }

    .track-stats {
        grid-template-columns: 1fr; 
        gap: 1rem;
    }

    /* Prediction Form */
    .submit-button {
        text-align: center;
        padding-left: 0;
    }

    .submit-button::before {
        display: none; 
    }
    
    .f1-car-showcase,
    .f1-sponsors-section {
        text-align: left;
    }
}
