/**
 * qrlink.ro - Stiluri CSS cu fundal mai deschis
 * Versiune alternativă pentru contrast maxim
 */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #2563eb;
    
    /* Culori text cu contrast maxim */
    --text-primary: #111827;
    --text-secondary: #1f2937;
    --text-muted: #374151;
    --text-light: #6b7280;
    
    /* Background mai deschis */
    --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 50%, #ddd6fe 100%);
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-white: #ffffff;
    
    /* Borders */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;
}

/* === LAYOUT DE BAZĂ CU FUNDAL DESCHIS === */
body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    font-weight: 500;
}

/* Adaugă un pattern subtil la fundal */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(79, 70, 229, 0.05) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.05) 2px, transparent 2px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* === TEXT CU CONTRAST MAXIM === */
.text-gray-800,
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.text-gray-700 {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

.text-gray-600 {
    color: var(--text-muted) !important;
    font-weight: 500 !important;
}

.text-gray-500 {
    color: var(--text-light) !important;
    font-weight: 500 !important;
}

/* === CARDURI CU FUNDAL SOLID === */
.instruction-card {
    background: var(--bg-white);
    border: 2px solid var(--border-light);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.instruction-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(79, 70, 229, 0.1);
}

.instruction-card h3 {
    color: var(--text-primary);
    font-weight: 700;
}

.instruction-card p {
    color: var(--text-muted);
    font-weight: 500;
}

/* === BUTOANE CU CONTRAST RIDICAT === */
.btn-primary {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    box-shadow: 
        0 4px 12px rgba(79, 70, 229, 0.3),
        0 2px 4px rgba(79, 70, 229, 0.2);
    border: none;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(79, 70, 229, 0.4),
        0 4px 8px rgba(79, 70, 229, 0.3);
}

/* === INPUT-URI CU CONTRAST ÎMBUNĂTĂȚIT === */
input[type="text"],
input[type="url"],
input[type="email"],
textarea,
select {
    background: var(--bg-white) !important;
    border: 2px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.04),
        0 0 0 3px rgba(79, 70, 229, 0.15) !important;
    background: #fefefe !important;
}

/* === FILE INPUT AREA === */
.file-input-area {
    background: rgba(255, 255, 255, 0.8);
    border: 3px dashed var(--border-medium);
    transition: all 0.3s ease;
}

.file-input-area:hover,
.file-input-area.dragover {
    border-color: var(--primary-color);
    background: rgba(249, 250, 251, 0.9);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.file-input-area.file-selected {
    border-color: var(--success-color);
    background: rgba(240, 253, 244, 0.9);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
}

/* === QR CONTAINER === */
.qr-container {
    background: var(--bg-white);
    border: 3px solid var(--border-light);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.qr-container:hover {
    border-color: var(--primary-color);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.12),
        0 6px 12px rgba(79, 70, 229, 0.1);
}

/* === STATISTICI === */
.bg-white {
    background: var(--bg-white) !important;
    border: 2px solid var(--border-light) !important;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.bg-white:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--primary-color) !important;
}

/* === NOTIFICĂRI CU FUNDAL SOLID === */
.notification {
    backdrop-filter: blur(8px);
    border-left: 5px solid;
    font-weight: 600;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08);
}

.notification.success { 
    background: rgba(16, 185, 129, 0.15);
    color: #064e3b;
    border-left-color: var(--success-color);
}

.notification.error { 
    background: rgba(220, 38, 38, 0.15);
    color: #7f1d1d;
    border-left-color: var(--error-color);
}

.notification.warning { 
    background: rgba(217, 119, 6, 0.15);
    color: #78350f;
    border-left-color: var(--warning-color);
}

.notification.info { 
    background: rgba(37, 99, 235, 0.15);
    color: #1e3a8a;
    border-left-color: var(--info-color);
}

/* === PROGRESS BAR === */
.progress-bar {
    background: var(--border-light);
    border: 1px solid var(--border-medium);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* === TOOLTIP === */
.tooltip::after {
    background: rgba(17, 24, 39, 0.95);
    color: white;
    font-weight: 600;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === HEADER TEXT === */
header h1 {
    color: white !important;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: 800;
}

header p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* === VIZUALIZATOR 3D SECTION === */
.bg-gradient-to-r {
    background: linear-gradient(135deg, #dbeafe 0%, #e9d5ff 100%) !important;
    border: 2px solid var(--border-light) !important;
    color: var(--text-primary) !important;
}

.bg-gradient-to-br {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 
        0 8px 24px rgba(79, 70, 229, 0.2),
        0 4px 8px rgba(79, 70, 229, 0.1);
}

/* === LABELS CU CONTRAST MAXIM === */
label {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* === FOOTER === */
footer {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

footer p,
footer a {
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

/* === ANIMAȚII ÎMBUNĂTĂȚITE === */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* === RESPONSIVE ÎMBUNĂTĂȚIT === */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .glass-effect {
        background: rgba(255, 255, 255, 0.95);
        padding: 1.5rem !important;
    }
    
    h1, h2, h3 {
        line-height: 1.2;
    }
    
    .btn-primary {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .instruction-card {
        padding: 1.5rem;
    }
    
    .notification {
        margin: 0.5rem;
        font-size: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .glass-effect {
        margin: 0.5rem;
        padding: 1rem !important;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .text-5xl {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .text-3xl {
        font-size: 1.875rem;
        line-height: 1.2;
    }
}

/* === HIGH RESOLUTION DISPLAYS === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glass-effect {
        border-width: 0.5px;
    }
    
    .instruction-card,
    .qr-container,
    .bg-white {
        border-width: 1px;
    }
    
    .btn-primary {
        box-shadow: 
            0 2px 8px rgba(79, 70, 229, 0.3),
            0 1px 4px rgba(79, 70, 229, 0.2);
    }
}

/* === PRINT STYLES === */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .glass-effect {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .text-gray-800,
    .text-gray-700,
    .text-gray-600,
    .text-gray-500 {
        color: black !important;
    }
    
    .btn-primary {
        background: #4f46e5 !important;
        color: white !important;
        box-shadow: none !important;
    }
}

/* === MOTION PREFERENCES === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .instruction-card:hover {
        transform: none;
    }
}

/* === FORCED Colors Mode (pentru accesibilitate) === */
@media (forced-colors: active) {
    .glass-effect {
        background: Canvas;
        border: 1px solid ButtonBorder;
        color: CanvasText;
    }
    
    .btn-primary {
        background: ButtonFace;
        color: ButtonText;
        border: 1px solid ButtonBorder;
    }
    
    .btn-primary:hover {
        background: Highlight;
        color: HighlightText;
    }
    
    .instruction-card {
        background: Canvas;
        border: 1px solid ButtonBorder;
        color: CanvasText;
    }
}

/* === CUSTOM PROPERTIES PENTRU TEME DINAMICE === */
[data-theme="high-contrast"] {
    --text-primary: #000000;
    --text-secondary: #000000;
    --text-muted: #333333;
    --bg-glass: rgba(255, 255, 255, 1);
    --border-medium: #000000;
}

[data-theme="high-contrast"] .glass-effect {
    background: var(--bg-glass);
    border: 2px solid var(--border-medium);
}

[data-theme="high-contrast"] .btn-primary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
}

/* === LOADING STATES === */
.loading-skeleton {
    background: linear-gradient(90deg, 
        var(--border-light) 25%, 
        rgba(255, 255, 255, 0.5) 50%, 
        var(--border-light) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === FOCUS MANAGEMENT === */
.focus-trap {
    position: relative;
}

.focus-trap:focus-within {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 8px;
}

/* === HOVER STATES PENTRU TOUCH DEVICES === */
@media (hover: none) and (pointer: coarse) {
    .hover-lift:hover,
    .instruction-card:hover,
    .bg-white:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    .btn-primary:hover {
        transform: none;
        background: var(--primary-color);
    }
}

/* === UTILITIES FINALE === */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}