/* Custom Properties */
:root {
    --color-cream: #FAF4EB;
    --color-gray: #919BA6;
    --color-blue: #16305F;
    --color-orange: #DD8554;
    --color-orange-hover: #C46D3B;
    --color-white: #FFFFFF;

    --font-main: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --color-cream: #12151c;
    --color-blue: #FAF4EB;
    --color-gray: #1e2532;
    --color-white: #0a0c10;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-cream);
    color: var(--color-blue);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.bg-cream {
    background-color: var(--color-cream);
}

.bg-gray {
    background-color: var(--color-gray);
    color: var(--color-blue);
}

.bg-blue {
    background-color: var(--color-blue);
    color: var(--color-white);
}

.text-white {
    color: var(--color-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Fixed Kanji Logo */
.kanji-fixed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    width: 60px;
    height: auto;
    opacity: 0.9;
    pointer-events: none;
}

.kanji-fixed img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.4s ease;
}

.kanji-fixed img.white-kanji {
    filter: brightness(0) invert(1);
}

/* Header */
#header {
    height: 150px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    background-color: transparent;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid transparent;
}

#header.scrolled {
    background-color: rgba(250, 244, 235, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(22, 48, 95, 0.1);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 60px;
}

.nav-logo-link {
    position: absolute;
    left: 90px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.nav-logo {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.hamburger {
    display: none;
    cursor: pointer;
    background-color: var(--color-blue);
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-cream);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-blue);
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--color-orange);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--color-orange);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.btn-dark-mode {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-dark-mode:hover {
    background-color: rgba(22, 48, 95, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

#header .btn-primary {
    background-color: var(--color-orange);
    color: var(--color-blue);
}

#header .btn-primary:hover {
    background-color: var(--color-blue);
    color: var(--color-white);
}

.btn-submit {
    background-color: var(--color-orange);
    color: var(--color-white);
    padding: 12px 40px;
    border-radius: 0;
}

.btn-submit:hover {
    background-color: var(--color-blue);
    color: var(--color-white);
}

/* Hero Section */
.hero {
    margin-top: 250px;
    margin-bottom: 150px;
    width: 100%;
    height: calc(100vh - 150px);
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 1000px;
    height: 100vh;
    overflow: hidden;

}

.hero-image video,
.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-fallback-img {
    display: none;
}

/* Nosotros Section */
.nosotros-section {
    padding: 100px 0;
    text-align: left;
}

.nosotros-container {
    max-width: 800px;
}

.nosotros-top {
    display: flex;
    align-items: flex-end;
    justify-content: left;
    gap: 20px;
    margin-bottom: 30px;
}

.nosotros-portrait {
    width: 200px;
    height: 200px;
    overflow: hidden;
}

.nosotros-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nosotros-title-small {
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-blue);
    line-height: 1.2;
}

.nosotros-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-blue);
    margin-bottom: 30px;
}

.nosotros-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Discipline Sections */
.discipline-section {
    padding: 100px 0;
}

.discipline-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.vertical-text {
    writing-mode: vertical-lr;
    text-orientation: upright;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 15px;
    text-transform: uppercase;
}

.discipline-logo {
    max-height: 350px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
}

.discipline-image {
    flex: 1;
    height: 500px;
    overflow: hidden;
}

.discipline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discipline-schedule {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 200px;
    line-height: 1.8;
}

/* Senseis Section */
.senseis-section {
    padding: 100px 0;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 50px;
    color: var(--color-blue);
}

.senseis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.sensei-card {
    background-color: var(--color-blue);
    color: var(--color-white);
    padding: 30px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.sensei-card:hover {
    transform: translateY(-5px);
    background-color: var(--color-orange);
}

.sensei-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.sensei-card p {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.5;
    opacity: 0.9;
}

/* Footer / Contact */
.footer {
    padding: 100px 0 50px;
    text-align: center;
}

.contact-quote {
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 300;
    margin-bottom: 20px;
}

.contact-email {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 50px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto 50px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 0;
    border: none;
    border-bottom: 1px solid rgba(22, 48, 95, 0.3);
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-blue);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--color-orange);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(22, 48, 95, 0.5);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.social-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-item:hover {
    background-color: var(--color-blue);
    color: var(--color-white);
}

.social-item:hover .icon {
    color: var(--color-white);
}

.icon {
    width: 24px;
    height: 24px;
    color: var(--color-blue);
}

/* Dark Mode Overrides */
[data-theme="dark"] #header.scrolled {
    background-color: rgba(18, 21, 28, 0.8);
    border-bottom: 1px solid rgba(250, 244, 235, 0.1);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    border-bottom: 1px solid rgba(250, 244, 235, 0.3);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: rgba(250, 244, 235, 0.5);
}

[data-theme="dark"] .btn-dark-mode:hover {
    background-color: rgba(250, 244, 235, 0.1);
}

[data-theme="dark"] .nav-logo,
[data-theme="dark"] #aikido .discipline-logo,
[data-theme="dark"] #jujutsu .discipline-logo {
    filter: brightness(0) invert(1);
}

/* En dark mode, el fondo de Kenjutsu es claro, así que el logo que era blanco debe hacerse azul oscuro (--color-blue) */
[data-theme="dark"] #kenjutsu .discipline-logo {
    filter: brightness(0) invert(14%) sepia(57%) saturate(2461%) hue-rotate(208deg) brightness(97%) contrast(97%);
}

[data-theme="dark"] .kanji-fixed img {
    filter: brightness(0) invert(1);
    /* Kanji blanco por defecto en Dark Mode */
}

[data-theme="dark"] .kanji-fixed img.white-kanji {
    filter: none;
    /* Kanji color original sobre el fondo oscuro/claro alterno */
}

/* Responsive */
@media (max-width: 1200px) {
    .kanji-fixed {
        display: none;
    }
}

@media (max-width: 992px) {
    .kanji-fixed {
        display: none;
    }

    .discipline-container {
        flex-direction: column;
    }

    .vertical-text {
        writing-mode: horizontal-tb;
        letter-spacing: 5px;
    }

    .discipline-schedule {
        text-align: center;
    }

    .senseis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        justify-content: space-between;
        padding: 0 20px;
    }

    .nav-logo-link {
        position: static;
        transform: none;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 150px;
        flex-direction: column;
        background-color: var(--color-blue);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
        z-index: 998;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 20px;
        margin-bottom: 20px;
    }

    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }

    .nav-controls {
        margin-left: 0;
    }

    .nav-links a {
        color: var(--color-cream);
        display: block;
        padding: 10px;
        font-size: 1.3rem;
    }

    .nav-links a::after {
        background-color: var(--color-cream);
    }

    #header .nav-menu .btn-primary {
        background-color: var(--color-cream);
        color: var(--color-blue);
    }

    .hero {
        margin-top: 150px;
        /* Adjust top spacing due to fixed menu */
    }

    .hero-video {
        display: none !important;
    }

    .hero-fallback-img {
        display: block !important;
    }

    .senseis-grid {
        grid-template-columns: 1fr;
    }

    .nosotros-title {
        font-size: 2.5rem;
    }

    .contact-email {
        font-size: 2rem;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
}