/* Autonomie.io Base Styles - Paleta Azul/Gris Profesional */
:root {
    /* Colores primarios - Azul */
    --primary-blue: #1e3a5f;
    --primary-blue-light: #2c5282;
    --primary-blue-hover: #1a3250;

    /* Colores secundarios - Gris */
    --secondary-gray: #4a5568;
    --secondary-gray-light: #718096;

    /* Gradientes principales */
    --gradient-primary: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    --gradient-light: linear-gradient(135deg, rgba(30, 58, 95, 0.9) 0%, rgba(44, 82, 130, 0.9) 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(30, 58, 95, 0.08) 0%, rgba(74, 85, 104, 0.08) 100%);

    /* Neutros */
    --white: #ffffff;
    --light-gray: #f7fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #4a5568;
    --text-dark: #2d3748;

    /* Sombras */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.15);

    /* Alias para compatibilidad */
    --primary-orange: #1e3a5f;
    --primary-red: #2c5282;
}

/* Scale entire platform to 110% */
html {
    font-size: 110%;
}

/* General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    max-width: none;
    padding: 1.5rem 0;
}

/* Header Styles */
.navbar {
    padding: 0 0;
}

.header-gradient {
    background: var(--gradient-primary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 60px;
}

.navbar-brand .brand-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-container {
    height: 50px;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    overflow: visible;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* New request button */
.btn-new-request {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

.btn-new-request:hover {
    background: linear-gradient(135deg, #1a3250 0%, #1e3a5f 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.btn-new-request i {
    margin-right: 0.3rem;
}

/* Footer logo styles */
.footer-logo-container {
    height: 100px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    border-radius: 8px;
    filter: brightness(1.2) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Fallback for when logo image is not available */
.logo-placeholder {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: var(--white) !important;
    font-weight: 500;
    margin: 0 5px;
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 6px 12px !important;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.navbar-nav .nav-link i {
    display: inline-block;
    vertical-align: middle;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-blue) !important;
    transform: translateY(-2px);
}

.custom-toggler {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.custom-toggler:focus {
    box-shadow: none;
}

/* Page Header Styles */
.page-header {
    background: var(--gradient-subtle);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-blue);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h1 i {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.page-header .page-subtitle {
    color: var(--secondary-gray-light);
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
}

.page-header .page-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.page-header .stat-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* User Icon in Navbar */
.navbar-user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.navbar-user-icon i {
    opacity: 0.9;
}

/* Dropdown Styles */
.dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--text-dark) !important;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 5px;
}

.dropdown-item:hover {
    background: var(--gradient-light);
    color: var(--white) !important;
    transform: translateX(5px);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-light);
    min-height: 70vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%" cy="40%"><stop offset="0%" stop-color="rgba(255,255,255,.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle fill="url(%23a)" cx="10" cy="10" r="10"/><circle fill="url(%23a)" cx="80" cy="10" r="8"/></svg>') repeat;
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    font-size: 1.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-light {
    background: var(--white);
    border: none;
    color: var(--primary-blue) !important;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-light:hover {
    background: var(--light-gray);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Footer Styles */
.footer-gradient {
    background: var(--gradient-primary);
    margin-top: auto;
    flex-shrink: 0;
}

.footer-gradient h5,
.footer-gradient h6 {
    color: var(--white);
    font-weight: 600;
}

.footer-gradient .social-links a {
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-gradient .social-links a:hover {
    transform: translateY(-3px);
    color: var(--light-gray) !important;
}

.emergency-contact {
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.emergency-contact:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.02);
}

/* Utility Classes */
.text-primary-orange,
.text-primary-blue {
    color: var(--primary-blue) !important;
}

.text-primary-red,
.text-secondary-gray {
    color: var(--secondary-gray) !important;
}

.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-primary) border-box;
}

.text-primary {
    color: var(--primary-blue) !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */

/* Prevent horizontal scroll and stabilize vertical scrollbar */
html {
    overflow-x: hidden;
    overflow-y: scroll; /* Always show vertical scrollbar to prevent content shift */
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Ensure all containers respect viewport */
.container, .container-fluid, .row {
    max-width: 100%;
}

@media (max-width: 991px) {
    /* Navbar items wrap properly */
    .navbar-nav {
        flex-wrap: wrap;
    }

    .navbar-nav .nav-link {
        padding: 8px 10px !important;
        font-size: 0.9rem;
    }

    /* Dashboard container responsive */
    .dashboard-container {
        margin: 1rem !important;
        padding: 1.5rem !important;
        max-width: calc(100vw - 2rem) !important;
    }

    /* Stats grid responsive */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* Tools grid responsive */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem 0.5rem;
    }

    .hero-section {
        min-height: 60vh;
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .logo-container {
        height: 50px;
        max-width: 150px;
    }

    .footer-logo-container {
        height: 70px;
        max-width: 150px;
    }

    .logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .navbar-brand .brand-text {
        font-size: 1.5rem;
    }

    .footer-gradient .col-lg-4,
    .footer-gradient .col-lg-2,
    .footer-gradient .col-lg-3 {
        text-align: center;
        margin-bottom: 2rem;
    }

    .header-gradient {
        padding: 0.25rem 0;
    }

    /* Navbar collapses properly */
    .navbar-collapse {
        background: rgba(0,0,0,0.1);
        border-radius: 8px;
        padding: 0.5rem;
        margin-top: 0.5rem;
    }

    /* Dashboard responsive for tablets */
    .dashboard-container {
        margin: 0.75rem !important;
        padding: 1rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-number {
        font-size: 1.75rem !important;
    }

    .stat-icon {
        width: 50px !important;
        height: 50px !important;
    }

    .stat-icon i {
        font-size: 1.25rem !important;
    }

    .tool-btn {
        padding: 1rem 0.5rem !important;
    }

    .tool-btn i {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 576px) {
    main {
        padding: 0.5rem;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section .lead {
        font-size: 1.1rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }

    .logo-container {
        height: 45px;
        max-width: 120px;
    }

    .footer-logo-container {
        height: 50px;
        max-width: 120px;
    }

    /* Container fluid no padding extra */
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Dashboard mobile - single column */
    .dashboard-container {
        margin: 0.5rem !important;
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .dashboard-container .page-header h1 {
        font-size: 1.5rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .tools-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.75rem !important;
    }

    .stat-card {
        padding: 1rem !important;
    }

    .stat-number {
        font-size: 1.5rem !important;
    }

    .stat-icon {
        width: 45px !important;
        height: 45px !important;
        margin-bottom: 0.75rem !important;
    }

    .stat-icon i {
        font-size: 1.1rem !important;
    }

    .stat-label {
        font-size: 0.8rem !important;
    }

    .section-title {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }

    .users-card {
        padding: 1rem !important;
    }

    .tool-btn {
        padding: 1rem !important;
        border-radius: 12px !important;
    }

    .tool-btn i {
        font-size: 1.25rem !important;
    }

    .tool-btn span {
        font-size: 0.8rem !important;
    }
}

/* Scrollbar: usar la del navegador por defecto */

/* Focus States for Accessibility */
.btn:focus,
.nav-link:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}