/**
 * WIREFRAME: Custom CSS Styles
 * 
 * TRACE: Estilos específicos para wireframes Tamix
 * SCOPE: Grid tarjetas, badges, espaciados, componentes tour, responsive
 * 
 * DOMINIO: Tamix SaaS - Evaluaciones Psicológicas
 * Bootstrap 5.x Compatible - Custom utilities y components
 */

/* ==============================================
   VARIABLES CSS CUSTOM PROPERTIES
   ============================================== */
:root {
    /* Colores Tamix Brand */
    --tamix-primary: #007bff;
    --tamix-secondary: #6c757d;
    --tamix-success: #28a745;
    --tamix-warning: #ffc107;
    --tamix-danger: #dc3545;
    --tamix-info: #17a2b8;
    --tamix-light: #f8f9fa;
    --tamix-dark: #343a40;
    
    /* Espaciado específico wireframes */
    --wireframe-spacing: 1.5rem;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    
    /* Tour específico */
    --tour-highlight: rgba(0, 123, 255, 0.8);
    --tour-border: 2px solid #007bff;
}

/* ==============================================
   LAYOUT BASE Y TIPOGRAFÍA
   ============================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #212529;
    background-color: #f8f9fa;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Headers específicos */
.display-4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.1rem;
    font-weight: 400;
}

/* ==============================================
   WIREFRAME CARDS SYSTEM
   ============================================== */
.wireframe-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--card-shadow);
}

.wireframe-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--tamix-primary);
}

/* Card headers específicos por color */
.card-header.bg-primary { background-color: var(--tamix-primary) !important; }
.card-header.bg-success { background-color: var(--tamix-success) !important; }
.card-header.bg-info { background-color: var(--tamix-info) !important; }
.card-header.bg-warning { background-color: var(--tamix-warning) !important; }
.card-header.bg-danger { background-color: var(--tamix-danger) !important; }
.card-header.bg-secondary { background-color: var(--tamix-secondary) !important; }
.card-header.bg-dark { background-color: var(--tamix-dark) !important; }

/* Card body enhancements */
.card-body {
    padding: 1.25rem;
}

.card-title {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
}

/* ==============================================
   BADGES Y STATUS INDICATORS
   ============================================== */
.badge {
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Badge outlines personalizados */
.bg-outline-primary {
    background-color: transparent !important;
    color: var(--tamix-primary) !important;
    border: 1px solid var(--tamix-primary);
}

.bg-outline-success {
    background-color: transparent !important;
    color: var(--tamix-success) !important;
    border: 1px solid var(--tamix-success);
}

.bg-outline-info {
    background-color: transparent !important;
    color: var(--tamix-info) !important;
    border: 1px solid var(--tamix-info);
}

.bg-outline-warning {
    background-color: transparent !important;
    color: var(--tamix-warning) !important;
    border: 1px solid var(--tamix-warning);
}

.bg-outline-danger {
    background-color: transparent !important;
    color: var(--tamix-danger) !important;
    border: 1px solid var(--tamix-danger);
}

.bg-outline-secondary {
    background-color: transparent !important;
    color: var(--tamix-secondary) !important;
    border: 1px solid var(--tamix-secondary);
}

.bg-outline-dark {
    background-color: transparent !important;
    color: var(--tamix-dark) !important;
    border: 1px solid var(--tamix-dark);
}

/* ==============================================
   NAVEGACIÓN Y BREADCRUMBS
   ============================================== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.breadcrumb {
    background-color: var(--tamix-light);
    border-radius: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-weight: 600;
    color: var(--tamix-secondary);
}

/* ==============================================
   BUTTONS Y INTERACTIVE ELEMENTS
   ============================================== */
.btn {
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button hover effects */
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==============================================
   TOUR SYSTEM STYLES
   ============================================== */
.tour-step {
    border: var(--tour-border);
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 0.375rem;
    position: relative;
    z-index: 1049;
}

.tour-highlight {
    box-shadow: 0 0 15px var(--tour-highlight);
    z-index: 1050;
    position: relative;
    animation: tourPulse 2s infinite ease-in-out;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow: 0 0 15px var(--tour-highlight);
    }
    50% {
        box-shadow: 0 0 25px var(--tour-highlight), 0 0 35px rgba(0, 123, 255, 0.4);
    }
}

/* Popover customizations para tour */
.popover {
    max-width: 400px;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.popover-header {
    background-color: var(--tamix-primary);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem 0.5rem 0 0;
}

.popover-body {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Tour navigation buttons */
.tour-nav-buttons {
    margin-top: 1rem;
    text-align: center;
}

.tour-nav-buttons .btn {
    margin: 0 0.25rem;
    font-size: 0.8rem;
}

/* ==============================================
   RESPONSIVE GRID ENHANCEMENTS
   ============================================== */
@media (max-width: 768px) {
    .wireframe-card {
        margin-bottom: 1.5rem;
    }
    
    .card-header h6 {
        font-size: 0.9rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* ==============================================
   ALERTS Y NOTIFICATIONS
   ============================================== */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--card-shadow);
}

.alert-info {
    background-color: #e7f3ff;
    color: #0c4a6e;
    border-left: 4px solid var(--tamix-info);
}

.alert-warning {
    background-color: #fff8e7;
    color: #92400e;
    border-left: 4px solid var(--tamix-warning);
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--tamix-danger);
}

/* ==============================================
   UTILITY CLASSES ESPECÍFICAS
   ============================================== */
.text-contrast {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bg-contrast {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #fff;
}

.border-thick {
    border-width: 2px !important;
}

.shadow-custom {
    box-shadow: var(--card-shadow-hover) !important;
}

.rounded-lg {
    border-radius: 0.75rem !important;
}

/* Spacing utilities extra */
.m-6 { margin: 4rem !important; }
.p-6 { padding: 4rem !important; }
.mb-6 { margin-bottom: 4rem !important; }
.mt-6 { margin-top: 4rem !important; }

/* ==============================================
   FOOTER STYLES
   ============================================== */
footer {
    background-color: var(--tamix-dark) !important;
}

footer h6 {
    color: #fff;
    font-weight: 600;
}

footer small {
    color: #adb5bd;
}

footer .text-muted {
    color: #6c757d !important;
}

/* ==============================================
   DEBUG Y DEVELOPMENT HELPERS
   ============================================== */
.debug-info {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1060;
    max-width: 300px;
}

.debug-info .card {
    border-color: var(--tamix-warning);
    background-color: rgba(255, 255, 255, 0.95);
}

/* ==============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators mejorados */
.btn:focus,
.nav-link:focus,
.dropdown-item:focus {
    outline: 2px solid var(--tamix-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wireframe-card {
        border-width: 2px;
        border-color: #000;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* ==============================================
   PRINT STYLES
   ============================================== */
@media print {
    .navbar,
    .tour-nav-buttons,
    .btn,
    footer {
        display: none !important;
    }
    
    .wireframe-card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }
    
    .card-header {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
}

/* ==============================================
   ANIMATION UTILITIES
   ============================================== */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==============================================
   TERMINOLOGÍA VISUAL INDICATORS
   ============================================== */
.domain-correct {
    border-left: 3px solid var(--tamix-success);
    background-color: #f0fff4;
    padding-left: 1rem;
}

.domain-incorrect {
    border-left: 3px solid var(--tamix-danger);
    background-color: #fff5f5;
    padding-left: 1rem;
}

/* Indicadores de dominio en cards */
.wireframe-card[data-use-case] {
    position: relative;
}

.wireframe-card[data-use-case]::before {
    content: "✓ Assessment Domain";
    position: absolute;
    top: -8px;
    right: 10px;
    background-color: var(--tamix-success);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    z-index: 10;
}

/* ==============================================
   RESPONSIVE ENHANCEMENTS FINALES
   ============================================== */
@media (min-width: 992px) {
    .wireframe-card:nth-child(3n+1) {
        clear: left;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .wireframe-card:nth-child(2n+1) {
        clear: left;
    }
}