:root {
    --primary-color: #e30613;
    --dark-bg: #111111;
    --text-grey: #cccccc;
    --footer-text: #333333;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding-top: 76px;
}

h1, h2, h3, h4, h5 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Navigation --- */
.navbar {
    background-color: #ffffff;
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    height: 65px; 
}

.nav-link {
    color: var(--dark-bg) !important;
    font-weight: 700;
    margin-left: 15px;
    transition: color 0.3s;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-light .navbar-toggler {
    color: rgba(0,0,0,.55);
    border-color: rgba(0,0,0,.1);
}

/* --- Hero Section --- */
.hero-section {
    height: calc(100vh - 76px);
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://rbracing.ro/files/header.png');
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.3s;
}

.hero-btn:hover {
    transform: scale(1.05);
    background-color: #c20510;
    color: white;
}

/* Sections General */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 15px auto;
}

/* About & History */
.history-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    height: 100%;
    border-left: 5px solid var(--primary-color);
}

.image-cropper-frame {
    width: 100%;
    height: 400px; /* Redus pentru a potrivi textul */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175); 
    position: relative;
}

.image-cropper-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

/* --- SWIPER CAROUSEL --- */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; 
    gap: 1.5rem;
    padding-bottom: 1.5rem; 
    padding-left: 10px;
    padding-right: 10px;
}

.scrolling-card {
    flex: 0 0 auto; 
    width: 300px; 
}

.scrolling-wrapper::-webkit-scrollbar {
    height: 8px;
}
.scrolling-wrapper::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}
.scrolling-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.swiper {
    width: 100%;
    height: 100%;
    padding-bottom: 40px !important;
}

.swiper-slide {
    height: auto;
    display: flex;
    justify-content: center;
}

.swiper-button-next, .swiper-button-prev {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* Results 2025 Highlight */
.results-section {
    background-color: var(--dark-bg);
    color: white;
}

.result-portrait {
    height: 350px;
    width: 100%;
    max-width: 280px;
    object-fit: cover;
    object-position: top center;
    border-radius: 8px;
    margin: 0 auto 20px auto;
    display: block;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.trophy-icon {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 20px;
}

/* Gallery Grid */
.gallery-img-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 24px;
    cursor: pointer;
    height: 250px;
     box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-img-container:hover img {
    transform: scale(1.05);
}

@media (max-width: 767px) {
    .mobile-hide {
        display: none;
    }
    .scrolling-card {
        width: 260px;
    }
    /* Ascundem sagetile swiper pe mobil */
    .swiper-button-next, .swiper-button-prev {
        display: none;
    }
}

/* Video Section */
.video-collapse-btn {
    transition: all 0.3s ease;
}
.video-collapse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(227, 6, 19, 0.4);
}
.video-container iframe {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* --- PARTNERS SECTION (OPTIMIZAT SAFARI) --- */
.partners-section {
    background-color: #ffffff;
    padding: 40px 0;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.partners-title {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Parteneri Tehnici (Small) */
.partners-section-small {
    background-color: #f9f9f9;
    padding: 20px 0;
    overflow: hidden;
    border-top: 1px solid #eee;
}

.partners-title-small {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 20px;
    color: #666;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.marquee-wrapper {
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.marquee-track {
    display: flex;
    align-items: center;
    animation: scroll-partners 50s linear infinite;
    width: max-content; 
}

.marquee-track:hover {
    animation-play-state: paused; 
}

/* FIX PENTRU SAFARI: Asiguram ca containerul pozei nu se intinde */
.partner-item {
    margin: 0 40px; 
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-item a {
    display: block; /* Important pentru Safari */
}

/* FIX PENTRU SAFARI: Dimensiuni explicite pentru logo-uri mari */
.partner-logo {
    height: 80px !important; 
    width: auto !important;
    max-width: none; /* Previne turtirea */
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
    display: block; /* Important pentru Safari */
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* FIX PENTRU SAFARI: Dimensiuni explicite pentru logo-uri mici */
.partner-logo-small {
    height: 50px !important; /* Fortam inaltimea */
    width: auto !important;
    max-width: none;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
    display: block; /* Important pentru Safari */
}

.partner-logo-small:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes scroll-partners {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Footer --- */
footer {
    background-color: #ffffff;
    color: var(--footer-text);
    padding: 50px 0 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

footer h5 {
    color: #000;
    font-weight: 700;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 10px;
    width: 20px;
}

.social-icon-link {
     color: #333;
     margin-right: 15px;
     font-size: 1.5rem;
     transition: color 0.3s;
}
.social-icon-link:hover {
    color: var(--primary-color);
}

.footer-link {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-link:hover {
    color: var(--primary-color);
}

/* Responsive tweaks */
@media (max-width: 991px) {
     body { padding-top: 86px; }
    .navbar-collapse {
        background: white;
        padding: 20px;
        border-top: 1px solid #eee;
    }
     .nav-link { margin-left: 0; padding: 10px 0; }
     
     .image-cropper-frame {
        height: 350px;
        margin-top: 20px;
    }
}
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
     .section-title::after { margin: 15px auto 0 auto; }
}