/* ===================================
   LAYOUT.CSS - Rey de la Cancha
   Layout components: Navbar, Footer, Sidebar
   =================================== */

/* Navbar Moderna */
.navbar-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px var(--shadow-color);
    padding: 1rem 0;
    border: none;
    position: sticky; /* sticky navbar */
    top: 0;
    z-index: 1030;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Navbar en tema oscuro */
[data-theme="dark"] .navbar-custom {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.navbar-custom .navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: white !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.navbar-custom .navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1.25rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-custom .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    transform: translateY(-2px);
}

.navbar-custom .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white !important;
}

.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-custom .nav-link:hover::after {
    width: 80%;
}

/* Botones en Navbar */
.navbar-custom .btn-navbar {
    background: white;
    color: #667eea;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-custom .btn-navbar:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.navbar-custom .navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dropdown en Navbar */
.navbar-custom .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.navbar-custom .dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.navbar-custom .dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

/* Footer Moderno */
.footer-custom {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 0 1.5rem 0;
    margin-top: 4rem;
    box-shadow: 0 -4px 12px var(--shadow-color);
    transition: background 0.3s ease;
}

/* Footer en tema claro */
[data-theme="light"] .footer-custom {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1f2937;
}

[data-theme="light"] .footer-custom h5 {
    color: #111827;
}

[data-theme="light"] .footer-custom a {
    color: #4b5563;
}

[data-theme="light"] .footer-custom a:hover {
    color: #667eea;
}

[data-theme="light"] .footer-custom .social-links a {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .footer-custom .social-links a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="light"] .footer-bottom {
    color: #6b7280;
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Footer en tema oscuro */
[data-theme="dark"] .footer-custom {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    color: #e2e8f0;
}

[data-theme="dark"] .footer-custom h5 {
    color: #f1f5f9;
}

[data-theme="dark"] .footer-custom a {
    color: #cbd5e1;
}

[data-theme="dark"] .footer-custom a:hover {
    color: #ffffff;
}

[data-theme="dark"] .footer-bottom {
    color: #94a3b8;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-custom h5 {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-custom h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.footer-custom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0;
}

.footer-custom a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-custom .social-links a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.footer-custom .social-links a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Main Content Container */
.main-content {
    min-height: calc(100vh - 400px);
    /* Remove top padding so hero can sit next to the navbar */
    padding: 0 0 2rem 0;
}

/* Sidebar (para futuras funcionalidades) */
.sidebar {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #667eea;
    transform: translateX(5px);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-menu a i,
.sidebar-menu a span {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Breadcrumb Moderno */
.breadcrumb-custom {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.breadcrumb-custom .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-custom .breadcrumb-item {
    font-weight: 500;
    color: #64748b;
}

.breadcrumb-custom .breadcrumb-item.active {
    color: #667eea;
    font-weight: 600;
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #94a3b8;
    font-size: 1.25rem;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0; /* reduce vertical spacing */
    margin-bottom: 1.5rem; /* less space below */
    border-radius: 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

/* Hero section spacing - ensure it sits flush below the navbar */
.hero-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin: 0;
}

/* ===================================
   RESPONSIVE DESIGN - Mobile First
   =================================== */

/* Tablets y Móviles Grandes (768px - 1024px) */
@media (max-width: 1024px) {
    .navbar-custom .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.95rem;
    }

    .main-content {
        padding: 0 0 1.5rem 0;
    }

    .footer-custom {
        padding: 2.5rem 0 1.25rem 0;
    }

    .page-header {
        padding: 1.75rem 0;
        margin-bottom: 1.25rem;
    }

    .page-header h1 {
        font-size: 2.25rem;
    }
}

/* Móviles Medianos y Grandes (576px - 768px) */
@media (max-width: 768px) {
    .navbar-custom {
        padding: 0.75rem 0;
    }

    .navbar-custom .navbar-brand {
        font-size: 1.5rem;
    }

    .navbar-custom .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
        text-align: center;
    }

    .navbar-custom .navbar-collapse {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem;
    }

    .navbar-custom .btn-navbar {
        width: 100%;
        margin-top: 0.5rem;
    }

    .footer-custom {
        padding: 2rem 0 1rem 0;
        text-align: center;
    }

    .footer-custom .row > div {
        margin-bottom: 2rem;
    }

    .footer-custom h5 {
        font-size: 1.125rem;
    }

    .footer-custom h5::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-custom .social-links {
        justify-content: center;
        display: flex;
    }

    .page-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .page-header h1 {
        font-size: 1.875rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    .sidebar {
        margin-bottom: 2rem;
        position: relative;
        top: 0;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.25rem;
    }

    /* Ajustes de columnas para móviles */
    .col-md-6, .col-lg-4, .col-lg-3 {
        margin-bottom: 1rem;
    }

    /* Cards más compactas en móvil */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-header {
        padding: 1rem;
    }

    /* Botones de acción apilados en móvil */
    .d-flex.gap-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
    }

    /* Formularios en móvil */
    .form-control, .form-select {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* Móviles Pequeños (320px - 576px) */
@media (max-width: 576px) {
    .navbar-custom {
        padding: 0.5rem 0;
    }

    .navbar-custom .navbar-brand {
        font-size: 1.25rem;
        letter-spacing: 0.5px;
    }

    .navbar-custom .nav-link {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.9rem;
    }

    .page-header {
        padding: 1.25rem 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: 12px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.875rem;
    }

    .footer-custom {
        padding: 1.5rem 0 0.75rem 0;
    }

    .footer-custom h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .footer-custom a {
        font-size: 0.9rem;
    }

    .footer-bottom {
        font-size: 0.8rem;
        padding-top: 1rem;
        margin-top: 1.5rem;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
        font-size: 1.1rem;
    }

    /* Títulos más pequeños */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.125rem !important;
    }

    h5 {
        font-size: 1rem !important;
    }

    /* Espaciado reducido */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    /* Cards ultra compactas */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem;
    }

    /* Botones más pequeños */
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    /* Badges más pequeños */
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    /* Tablas responsivas */
    .table {
        font-size: 0.85rem;
    }

    /* Dashboard stats en columna única */
    .row.g-3 {
        gap: 0.75rem !important;
    }

    /* Modales en pantalla completa */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-fullscreen-sm-down {
        width: 100vw;
        max-width: none;
        margin: 0;
    }
}

/* Landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar-custom {
        padding: 0.25rem 0;
    }

    .page-header {
        padding: 0.75rem 0;
        margin-bottom: 0.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        padding: 0;
    }

    .back-to-top {
        width: 35px;
        height: 35px;
        bottom: 0.75rem;
        right: 0.75rem;
    }
}

/* Ultra wide screens (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }

    .navbar-custom .nav-link {
        font-size: 1.125rem;
    }

    .page-header h1 {
        font-size: 3rem;
    }

    .page-header p {
        font-size: 1.25rem;
    }
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    transition: width 0.2s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* Utility for compact sections to reduce vertical spacing */
.section-compact {
    margin-bottom: 1rem !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Particle container element placed inside hero sections */
[id$='-particles'] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 0 !important;
}
