/* Estilos de componentes para el Planificador de Feria */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

body.dark-mode .modal-content {
    background: #3d3d3d;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

body.dark-mode .modal-title {
    color: var(--secondary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

body.dark-mode .form-input,
body.dark-mode .form-textarea,
body.dark-mode .form-select {
    background: #2d3436;
    border-color: #555;
    color: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    background: var(--primary);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    width: 45px;
    height: 45px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Simple Sidebar Toggle - Oculto por defecto */
#simpleSidebarToggle {
    display: none;
}

/* Mostrar solo en pantallas pequeñas */
@media (max-width: 768px) {
    #simpleSidebarToggle {
        display: block !important;
        position: fixed !important;
        top: 15px !important;
        left: 15px !important;
        z-index: 10001 !important;
        background: #ff0000 !important;
        color: white !important;
        border: 3px solid #ffffff !important;
        border-radius: 50% !important;
        width: 50px !important;
        height: 50px !important;
        cursor: pointer !important;
        font-size: 1.5rem !important;
        text-align: center !important;
        line-height: 44px !important;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

.toast.warning {
    background: var(--warning);
    color: #333;
}

.toast.info {
    background: var(--info);
    color: white;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10px;
}

.badge-primary {
    background-color: var(--primary);
    color: white;
}

.badge-secondary {
    background-color: var(--secondary);
    color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: #333;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

/* Card */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

body.dark-mode .card {
    background: #3d3d3d;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

body.dark-mode .card-header {
    border-bottom-color: #555;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 20px;
}

body.dark-mode .card-footer {
    border-top-color: #555;
}

/* Alert */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

body.dark-mode .alert-success {
    color: #d4edda;
    background-color: #155724;
    border-color: #c3e6cb;
}

body.dark-mode .alert-danger {
    color: #f8d7da;
    background-color: #721c24;
    border-color: #f5c6cb;
}

body.dark-mode .alert-warning {
    color: #fff3cd;
    background-color: #856404;
    border-color: #ffeaa7;
}

body.dark-mode .alert-info {
    color: #d1ecf1;
    background-color: #0c5460;
    border-color: #bee5eb;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
}

body.dark-mode .dropdown-content {
    background-color: #3d3d3d;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

body.dark-mode .dropdown-content a {
    color: #fff;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

body.dark-mode .dropdown-content a:hover {
    background-color: #555;
}

/* Tabs */
.tabs {
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.tab-button:hover {
    background-color: rgba(106, 17, 203, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Accordion */
.accordion {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.dark-mode .accordion-header {
    background: #2d3436;
}

.accordion-header:hover {
    background: #e9ecef;
}

body.dark-mode .accordion-header:hover {
    background: #3d3d3d;
}

.accordion-content {
    padding: 20px;
    display: none;
}

.accordion-content.show {
    display: block;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-title {
    font-size: 0.9rem;
    color: #666;
}

.step.active .step-title {
    color: var(--primary);
    font-weight: bold;
}

.step.completed .step-title {
    color: var(--success);
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
}

.timeline-item.completed::before {
    background: var(--success);
    border-color: var(--success);
}

.timeline-item.current::before {
    background: var(--primary);
    border-color: var(--primary);
}

.timeline-content {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

body.dark-mode .timeline-content {
    background: #3d3d3d;
}

.timeline-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-description {
    color: #666;
    font-size: 0.9rem;
}

/* Modal de Tutorial */
.tutorial-modal {
    max-width: 700px !important;
    width: 90% !important;
    z-index: 10002 !important; /* Mayor que el sidebar */
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Asegurar que el modal del tutorial esté por encima de todo */
#tutorialModal {
    z-index: 10002 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#tutorialModal .modal-content {
    position: relative !important;
    z-index: 10003 !important;
    max-width: 700px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
}

.tutorial-steps {
    margin-bottom: 30px;
}

.tutorial-step {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tutorial-step p {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #666;
}

.tutorial-image {
    margin: 20px 0;
    color: var(--primary);
    opacity: 0.8;
}

.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 20px;
}

.tutorial-nav-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-nav-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.tutorial-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.tutorial-dots {
    display: flex;
    gap: 8px;
}

.tutorial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.tutorial-dot:hover {
    background: var(--secondary);
}

.tutorial-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--success);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Modo oscuro para el tutorial */
body.dark-mode .tutorial-step p {
    color: #ccc !important;
}

body.dark-mode .tutorial-image {
    color: #4a9eff !important;
}

body.dark-mode .tutorial-dot {
    background: #555 !important;
}

body.dark-mode .tutorial-dot.active {
    background: #7b2cbf !important;
}

body.dark-mode .tutorial-dot:hover {
    background: #6a0dad !important;
}

/* Controles del header del sidebar */
.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tutorial-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-size: 1rem;
    transition: var(--transition);
}

.tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Modo oscuro para el botón de tutorial */
body.dark-mode .tutorial-btn {
    color: var(--light);
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tutorial-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tutorial-btn-bottom {
    background: linear-gradient(to right, #17a2b8, #20c997);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.tutorial-btn-bottom:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.tutorial-btn-bottom:active {
    transform: translateY(0);
}

/* Logo de la aplicación en el sidebar */
.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    /* Removido el filtro blanco para mantener colores originales */
    transition: var(--transition);
}

.logo-image:hover {
    transform: scale(1.05);
    /* Efecto sutil de sombra sin cambiar colores */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

/* Modo oscuro para el logo */
body.dark-mode .logo-image {
    /* En modo oscuro, aplicar un filtro sutil para mejor contraste */
    filter: brightness(1.1) contrast(1.1);
}

body.dark-mode .logo-image:hover {
    filter: brightness(1.1) contrast(1.1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.1));
}

/* Responsive para el logo */
@media (max-width: 768px) {
    .logo-image {
        max-height: 50px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        max-height: 40px;
    }
}
