:root {
    --primary-color: #1f2f72;
    --secondary-color: #3a4a8f;
    --primary-light: #4a5aa0;
    --primary-dark: #151f4d;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --light-color: #f7fafc;
    --dark-color: #2d3748;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: var(--dark-color);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

.login-header h1 {
    font-weight: 600;
    margin-bottom: 10px;
}

.login-body {
    padding: 40px;
}

.login-footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 0.875rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Microsoft Login Button */
.btn-microsoft {
    background-color: #ffffff;
    color: #5e5e5e;
    border: 1px solid #8c8c8c;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-microsoft:hover {
    background-color: #f8f8f8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.microsoft-logo {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
}

.divider span {
    background-color: white;
    padding: 0 20px;
    position: relative;
    color: #718096;
    font-size: 14px;
}

.demo-notice {
    background-color: #f0f9ff;
    border: 1px solid #90cdf4;
    border-radius: 8px;
    padding: 12px 16px;
    color: #2563eb;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    margin-bottom: 20px;
}

/* Navigation and Header Styles */
.bg-gradient-primary {
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-container {
    background-color: #e2e8f0;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 10px 16px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: #1f2f72;
    box-shadow: 0 0 0 3px rgba(31, 47, 114, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-text {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 4px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
    padding: 20px;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 47, 114, 0.3);
    background: linear-gradient(135deg, #2a3a7d 0%, #4a5aa0 100%);
}

.btn-secondary {
    background-color: #718096;
    border: none;
}

.btn-secondary:hover {
    background-color: #4a5568;
}

.btn-success {
    background-color: var(--success-color);
    border: none;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline-secondary {
    color: #718096;
    border-color: #cbd5e0;
}

.btn-outline-secondary:hover {
    background-color: #f7fafc;
    border-color: #a0aec0;
}

/* Navigation Pills */
.nav-pills .nav-link {
    color: var(--dark-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: var(--transition);
    text-align: left;
}

.nav-pills .nav-link:hover {
    background-color: #f7fafc;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
    color: white;
}

/* Form Validation */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--danger-color);
}

.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: var(--success-color);
}

/* Checkboxes */
.form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: #1f2f72;
    border-color: #1f2f72;
}

/* Logo styles */
.logo-minerd {
    width: 180px;
    height: auto;
}

.logo-section {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Override any remaining purple/violet colors */
* {
    --bs-primary: #1f2f72 !important;
    --bs-primary-rgb: 31, 47, 114 !important;
}

/* Alert Styles */
.alert-info {
    background-color: #f0f9ff;
    border: 1px solid #90cdf4;
    color: #2563eb;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

/* Sidebar Collapse Styles */
#sidebar-container {
    transition: all 0.3s ease;
    flex: 0 0 25%;
    max-width: 25%;
}

#sidebar-container.collapsed {
    flex: 0 0 80px;
    max-width: 80px;
}

#sidebar-container.collapsed .nav-text {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#sidebar-container.collapsed .d-flex {
    justify-content: center;
}

#sidebar-container.collapsed #sidebar-title {
    font-size: 0;
    width: 0;
    overflow: hidden;
}

#sidebar-container.collapsed #sidebar-title i {
    font-size: 1.2rem;
    margin: 0 !important;
}

#sidebar-container.collapsed .nav-link {
    justify-content: center;
    padding: 12px 8px;
    display: flex;
    align-items: center;
}

#sidebar-container.collapsed .nav-link i {
    margin: 0 !important;
    font-size: 1.3rem;
}

#sidebar-container.collapsed #toggleSidebar i {
    transform: rotate(180deg);
}

#toggleSidebar {
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#toggleSidebar:hover {
    background-color: #e2e8f0;
}

#toggleSidebar i {
    transition: transform 0.3s ease;
}

#content-container {
    transition: all 0.3s ease;
    flex: 0 0 75%;
    max-width: 75%;
}

#content-container.expanded {
    flex: 1;
    max-width: calc(100% - 80px);
}

/* Floating Save Button Adjustments */
.floating-save-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    /* En tablets y móviles, el sidebar se convierte en overlay */
    #sidebar-container {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 1050;
        width: 280px;
        max-width: 280px;
        flex: none;
        transition: left 0.3s ease;
        overflow-y: auto;
        margin-bottom: 0;
        padding: 15px;
        background-color: #f8f9fa;
    }

    #sidebar-container .card {
        margin-bottom: 0;
        height: 100%;
        border-radius: 0;
    }

    #sidebar-container:not(.collapsed) {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    #sidebar-container.collapsed {
        left: -280px;
        max-width: 280px;
        flex: none;
    }

    /* Botón flotante para abrir sidebar en móviles */
    #toggleSidebar {
        position: fixed;
        top: 80px;
        left: 15px;
        z-index: 1051;
        background-color: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border: 1px solid #cbd5e0;
        width: 40px;
        height: 40px;
    }

    #toggleSidebar i::before {
        content: "\f0c9"; /* bars icon */
    }

    #sidebar-container:not(.collapsed) #toggleSidebar {
        position: relative;
        top: auto;
        left: auto;
        box-shadow: none;
        width: 32px;
        height: 32px;
    }

    #sidebar-container:not(.collapsed) #toggleSidebar i::before {
        content: "\f00d"; /* times icon */
    }

    #sidebar-container.collapsed #toggleSidebar i {
        transform: none;
    }

    /* Backdrop cuando el sidebar está abierto */
    body.sidebar-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1049;
    }

    #content-container {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
    }

    #content-container.expanded {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* En móvil, mostrar textos completos siempre */
    #sidebar-container .nav-text {
        display: inline !important;
        opacity: 1 !important;
    }

    #sidebar-container .nav-link {
        justify-content: flex-start !important;
        padding: 12px 16px !important;
    }

    #sidebar-container .nav-link i {
        margin-right: 0.5rem !important;
        font-size: 1rem !important;
    }

    #sidebar-container #sidebar-title {
        font-size: initial !important;
        width: auto !important;
        overflow: visible !important;
    }

    #sidebar-container .d-flex {
        justify-content: space-between !important;
    }
}

@media (max-width: 768px) {
    .login-body {
        padding: 30px 20px;
    }

    .navbar .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-pills .nav-link {
        font-size: 14px;
        padding: 10px 12px;
    }

    .floating-save-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    /* Botones de navegación en móvil */
    .btn-navigation {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Cards del formulario */
    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 15px;
    }

    /* Formularios más compactos en móvil */
    .form-control,
    .form-select {
        font-size: 16px; /* Evita zoom en iOS */
    }

    .col-md-6,
    .col-md-4,
    .col-md-3 {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Loading States */
.spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Transitions and Animations */
.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}