/**
 * Main CSS file for the Imprenta website
 */

/* Global styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #1abc9c;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333333;
    --border-radius: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    
    /* Transition variables for theme switching */
    --theme-transition-time: 0.3s;
    --theme-transition-easing: ease;
}

/* Apply transitions to elements that change with theme */
html {
    transition: background-color var(--theme-transition-time) var(--theme-transition-easing),
                color var(--theme-transition-time) var(--theme-transition-easing);
}

/* Transiciones para elementos comunes */
body, .card, .navbar, .dropdown-menu, .modal-content, 
.list-group-item, .form-control, .btn, .table, .alert,
input, select, textarea, .form-check-input, .card-header, 
.card-footer, .toast, .accordion-item, .badge, .progress {
    transition: background-color var(--theme-transition-time) var(--theme-transition-easing),
                color var(--theme-transition-time) var(--theme-transition-easing),
                border-color var(--theme-transition-time) var(--theme-transition-easing),
                box-shadow var(--theme-transition-time) var(--theme-transition-easing);
}

/* Transición para elementos SVG y otros gráficos */
svg, .fa, .fas, .far, .fab, .chart-area, .img-thumbnail {
    transition: fill var(--theme-transition-time) var(--theme-transition-easing),
                color var(--theme-transition-time) var(--theme-transition-easing),
                filter var(--theme-transition-time) var(--theme-transition-easing);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Override Bootstrap primary color */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #253444;
    border-color: #253444;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Navbar styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff;
}

/* Card styles */
.card {
    box-shadow: var(--box-shadow);
    border: none;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Hero section */
.hero {
    margin-top: -1.5rem;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Product cards */
.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #6c757d;
}

/* Product thumbnails */
.product-thumbnail {
    max-height: 150px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
}

/* Categorías desplegables en catálogo */
.card-header .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
    transition: all 0.3s ease;
}

.card-header .btn-light {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header .btn-light:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.collapse.collapsing {
    transition: height 0.35s ease;
}

[data-bs-toggle="collapse"] .fa-chevron-down,
[data-bs-toggle="collapse"] .fa-chevron-up {
    transition: transform 0.3s ease;
}

/* Form styles */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25);
}

.form-control.is-invalid {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 30px;
}

/* Progress bar */
.progress {
    height: 10px;
    border-radius: 30px;
    background-color: #e9ecef;
}

.progress-bar {
    background-color: var(--primary-color);
}

/* Footer styles */
footer {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 3rem 0;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
    text-decoration: none;
}

footer h5 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

footer hr {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

/* Order status page */
.timeline-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.timeline-step {
    text-align: center;
    position: relative;
    width: 100%;
    flex: 1;
}

.timeline-step:not(:last-child):after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #e9ecef;
    top: 15px;
    left: 50%;
    z-index: -1;
}

.timeline-step.active:not(:last-child):after {
    background-color: var(--primary-color);
}

.timeline-step .inner-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.timeline-step.active .inner-circle {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Responsive styles */
@media (max-width: 767.98px) {
    .hero {
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .timeline-steps {
        flex-direction: column;
    }
    
    .timeline-step {
        margin-bottom: 1rem;
    }
    
    .timeline-step:not(:last-child):after {
        display: none;
    }
    
    /* Categorías desplegables en dispositivos móviles */
    .card-header .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .list-group-item {
        padding: 0.75rem 1rem;
    }
}

/* Animation effects */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Custom utilities */
.border-left-primary {
    border-left: 4px solid var(--primary-color);
}

.border-left-success {
    border-left: 4px solid #1abc9c;
}

.border-left-info {
    border-left: 4px solid #3498db;
}

.border-left-warning {
    border-left: 4px solid #f39c12;
}

.border-left-danger {
    border-left: 4px solid #e74c3c;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s ease;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.theme-toggle-btn:hover {
    color: white;
}

/* Show only sun icon when dark theme is active, only moon when light theme is active */
.theme-toggle-btn .fa-sun {
    display: none;
}

.theme-toggle-btn .fa-moon {
    display: inline-block;
}

.dark-theme .theme-toggle-btn .fa-sun {
    display: inline-block;
}

.dark-theme .theme-toggle-btn .fa-moon {
    display: none;
}

/* Additional classes for theme transitions */
.notification-item,
.bg-light,
.bg-dark {
    transition: 
        background-color var(--theme-transition-time) var(--theme-transition-easing), 
        color var(--theme-transition-time) var(--theme-transition-easing), 
        border-color var(--theme-transition-time) var(--theme-transition-easing), 
        box-shadow var(--theme-transition-time) var(--theme-transition-easing);
}
