/**
 * FACIALTEC - Estilos CSS
 * Sistema de Análisis Facial con IA
 */

/* =====================================================
   VARIABLES Y RESET
   ===================================================== */
:root {
    --primary: #9a6cff;
    --primary-dark: #7c4dff;
    --primary-light: #b794ff;
    --secondary: #ffdfd3;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #1a1a2e;
    --text-light: #666;
    --text-muted: #888;
    --bg: #ffffff;
    --bg-light: #f8f5ff;
    --border: rgba(154, 108, 255, 0.15);
    --shadow: 0 8px 30px rgba(154, 108, 255, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --font: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: linear-gradient(135deg, #fff 0%, #f8f5ff 50%, #f0ebff 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =====================================================
   BACKGROUND EFFECTS
   ===================================================== */
.app-background {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(154, 108, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(154, 108, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 223, 211, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(154, 108, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154, 108, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* =====================================================
   CONTAINER
   ===================================================== */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    text-align: center;
    padding: 25px 20px;
    margin-bottom: 20px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 8px 25px rgba(154, 108, 255, 0.35);
    animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 25px rgba(154, 108, 255, 0.35); }
    50% { box-shadow: 0 8px 35px rgba(154, 108, 255, 0.5); }
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 13px;
    color: rgba(154, 108, 255, 0.8);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(154, 108, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary), var(--primary), var(--secondary));
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(154, 108, 255, 0.15), rgba(255, 223, 211, 0.3));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 30px;
    padding-left: 52px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(154, 108, 255, 0.3), transparent);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 3px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(154, 108, 255, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a6cff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 30px rgba(154, 108, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(154, 108, 255, 0.45);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: rgba(154, 108, 255, 0.08);
    color: var(--primary);
    border: 2px solid rgba(154, 108, 255, 0.25);
}

.btn-secondary:hover {
    background: rgba(154, 108, 255, 0.12);
    border-color: var(--primary);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

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

/* =====================================================
   CLIENT INFO BAR
   ===================================================== */
.client-info-bar {
    background: linear-gradient(135deg, rgba(154, 108, 255, 0.08), rgba(255, 223, 211, 0.15));
    border: 1px solid rgba(154, 108, 255, 0.1);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.client-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.client-details p {
    font-size: 13px;
    color: var(--text-light);
}

/* =====================================================
   UPLOAD ZONE
   ===================================================== */
.upload-zone {
    border: 2px dashed rgba(154, 108, 255, 0.35);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(154, 108, 255, 0.02);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(154, 108, 255, 0.05);
}

.upload-zone.has-image {
    padding: 20px;
    border-style: solid;
    cursor: default;
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(154, 108, 255, 0.1);
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 18px;
    display: block;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.preview-image {
    max-width: 100%;
    max-height: 350px;
    border-radius: var(--radius-lg);
    object-fit: contain;
}

/* =====================================================
   TIPS
   ===================================================== */
.tips-section {
    margin-top: 30px;
}

.tips-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tip-item {
    background: rgba(154, 108, 255, 0.05);
    border: 1px solid rgba(154, 108, 255, 0.1);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
}

.tip-icon {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--primary);
}

.tip-text {
    font-size: 12px;
    color: var(--text-light);
}

/* =====================================================
   ANALYZING ANIMATION
   ===================================================== */
.analyzing-container {
    max-width: 500px;
    margin: 50px auto;
    text-align: center;
}

.scanner-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 35px;
}

.scanner-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(154, 108, 255, 0.5);
}

.scanner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.scanner-ring:nth-child(2) {
    width: 88%;
    height: 88%;
    top: 6%;
    left: 6%;
    animation-duration: 1.5s;
    animation-direction: reverse;
    border-top-color: var(--primary-dark);
}

.scanner-ring:nth-child(3) {
    width: 112%;
    height: 112%;
    top: -6%;
    left: -6%;
    animation-duration: 2s;
    border-top-color: var(--primary-light);
}

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

.scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    transform: translate(-50%, -50%);
    animation: scanRotate 2s ease-in-out infinite;
}

@keyframes scanRotate {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: particleFloat 2s ease-in-out infinite;
}

.particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.3s; }
.particle:nth-child(3) { top: 70%; left: 15%; animation-delay: 0.6s; }
.particle:nth-child(4) { top: 80%; left: 75%; animation-delay: 0.9s; }
.particle:nth-child(5) { top: 40%; left: 5%; animation-delay: 1.2s; }
.particle:nth-child(6) { top: 50%; left: 95%; animation-delay: 1.5s; }

@keyframes particleFloat {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

.analysis-status {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.progress-container {
    background: rgba(154, 108, 255, 0.1);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* =====================================================
   RESULTS
   ===================================================== */
.results-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.result-image-container {
    position: relative;
}

.result-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow);
}

.verified-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--accent), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid #fff;
    color: #fff;
}

.overall-info {
    text-align: left;
}

.overall-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.overall-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.client-name-result {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.skin-age {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(154, 108, 255, 0.08);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
}

.skin-age-label {
    color: var(--text-light);
}

.skin-age-value {
    color: var(--primary);
    font-weight: 600;
}

/* Score Ring */
.score-ring {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-value {
    position: absolute;
    font-size: 28px;
    font-weight: 700;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 22px;
}

/* Categories Nav */
.categories-nav {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.category-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--text-light);
    margin-bottom: 6px;
    font-family: var(--font);
}

.category-btn:last-child {
    margin-bottom: 0;
}

.category-btn:hover {
    background: rgba(154, 108, 255, 0.06);
    color: var(--text);
}

.category-btn.active {
    background: linear-gradient(135deg, rgba(154, 108, 255, 0.12), rgba(255, 223, 211, 0.15));
    border: 1px solid rgba(154, 108, 255, 0.2);
    color: var(--text);
}

.category-icon {
    width: 36px;
    height: 36px;
    background: rgba(154, 108, 255, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.category-btn.active .category-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-score-bar {
    height: 4px;
    background: rgba(154, 108, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.category-score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.category-score-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

/* Detail Panel */
.detail-panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.detail-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow);
}

.detail-title-area h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.detail-score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(154, 108, 255, 0.08);
    border-radius: 18px;
    font-size: 12px;
}

.detail-score-label {
    color: var(--text-muted);
}

.detail-score-value {
    font-weight: 700;
}

/* Detail Content Grid */
.detail-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Analysis Image with Markers */
.analysis-image-container {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 15px;
}

.analysis-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

.markers-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.marker {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: markerPulse 2s ease-in-out infinite;
}

.marker-small { width: 8px; height: 8px; }
.marker-medium { width: 12px; height: 12px; }
.marker-large { width: 18px; height: 18px; opacity: 0.7; }
.marker-area { width: 30px; height: 30px; opacity: 0.4; }

@keyframes markerPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* Legend */
.markers-legend {
    background: rgba(154, 108, 255, 0.04);
    border-radius: var(--radius);
    padding: 15px;
}

.markers-legend h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    color: #555;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Detail Items */
.detail-info-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-items {
    display: grid;
    gap: 12px;
}

.detail-item {
    background: rgba(154, 108, 255, 0.03);
    border: 1px solid rgba(154, 108, 255, 0.08);
    border-radius: var(--radius);
    padding: 14px;
}

.detail-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detail-item-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.detail-item-value {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.detail-item-meta {
    font-size: 11px;
    color: rgba(154, 108, 255, 0.8);
}

/* Recommendation Box */
.recommendation-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.03));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
    padding: 16px;
}

.recommendation-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.recommendation-text {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
}

/* Disclaimer */
.disclaimer-box {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11px;
    color: rgba(180, 130, 20, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Glogau Scale */
.glogau-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.glogau-level {
    background: rgba(154, 108, 255, 0.03);
    border: 2px solid rgba(154, 108, 255, 0.15);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.glogau-level.active {
    background: linear-gradient(135deg, rgba(154, 108, 255, 0.1), rgba(255, 223, 211, 0.1));
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.glogau-num {
    font-size: 22px;
    font-weight: 700;
    color: rgba(154, 108, 255, 0.35);
    margin-bottom: 4px;
}

.glogau-level.active .glogau-num {
    color: var(--primary);
}

.glogau-label {
    font-size: 10px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.glogau-age {
    font-size: 9px;
    color: var(--text-muted);
}

.glogau-description {
    background: rgba(154, 108, 255, 0.05);
    border: 1px solid rgba(154, 108, 255, 0.12);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}

/* =====================================================
   LOADING & TOAST
   ===================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(154, 108, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--accent); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--primary); }

.toast-icon { font-size: 20px; }
.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--primary); }

.toast-message { flex: 1; font-size: 14px; }

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
}

/* =====================================================
   PWA INSTALL PROMPT
   ===================================================== */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: none;
    z-index: 9998;
}

.pwa-install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-prompt-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pwa-prompt-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.pwa-prompt-text h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pwa-prompt-text p { font-size: 13px; color: var(--text-light); }

.pwa-prompt-actions {
    display: flex;
    gap: 10px;
}

.pwa-prompt-actions .btn {
    flex: 1;
    padding: 12px;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden { display: none !important; }
.fade-in-up { animation: fadeInUp 0.6s ease-out; }

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

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
    .detail-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .results-grid { grid-template-columns: 1fr; }
    
    .categories-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 12px;
        position: static;
    }
    
    .category-btn {
        flex-shrink: 0;
        width: auto;
        margin-bottom: 0;
    }
    
    .glogau-scale { grid-template-columns: repeat(2, 1fr); }
    
    .results-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .result-image-container { margin: 0 auto; }
    .overall-info { text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid.three-cols { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .app-container { padding: 15px; }
    .card { padding: 25px; }
    .tips-grid { grid-template-columns: 1fr; }
    .upload-zone { padding: 35px 20px; }
    .upload-icon { font-size: 44px; }
    .scanner-container { width: 200px; height: 200px; }
    .scanner-image { width: 140px; height: 140px; }
    .actions { flex-direction: column; }
    .btn { width: 100%; }
    .logo-text { font-size: 22px; }
    .header { padding: 15px; }
}

/* Print Styles */
@media print {
    .header, .actions, .btn, .pwa-install-prompt, .toast-container { display: none !important; }
    .app-background, .grid-overlay { display: none !important; }
    .card, .results-header, .detail-panel, .categories-nav { 
        box-shadow: none !important; 
        border: 1px solid #ddd !important;
    }
}
