/* ===== AI FACE AGE DETECTOR CSS ===== */

/* Model Banner */
.age-model-banner {
    background: linear-gradient(135deg, #1e1b4b, #4c1d95, #7c3aed);
    border-radius: 16px;
    padding: 28px 30px;
    color: #fff;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.age-model-spinner {
    width: 44px; height: 44px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #c4b5fd;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.age-model-info strong { display: block; font-size: 18px; margin-bottom: 4px; }
.age-model-info span   { font-size: 13px; opacity: 0.8; }
.age-model-bar  { width: 100%; max-width: 320px; background: rgba(255,255,255,0.2); height: 8px; border-radius: 999px; overflow: hidden; }
.age-model-fill { height: 100%; background: linear-gradient(90deg, #c4b5fd, #a78bfa); border-radius: 999px; transition: width 0.7s ease; }

/* Main Layout */
.age-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
    align-items: start;
}

/* Left — Upload */
.age-left {}

.age-upload-zone {
    border: 3px dashed #ddd6fe;
    border-radius: 20px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    padding: 50px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}
.age-upload-zone:hover,
.age-upload-zone.age-drag-over {
    border-color: #7c3aed;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    transform: scale(1.01);
}
.age-upload-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.age-upload-icon  { font-size: 56px; }
.age-upload-title { font-size: 20px; font-weight: 800; color: #1f2937; }
.age-upload-sub   { font-size: 13px; color: #6b7280; max-width: 260px; line-height: 1.5; }
.age-upload-types { font-size: 12px; color: #9ca3af; background: #f3f4f6; padding: 4px 14px; border-radius: 20px; }
.age-upload-btn {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff; border: none; border-radius: 12px;
    padding: 12px 28px; font-size: 15px; font-weight: 700;
    cursor: pointer; margin-top: 6px; transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}
.age-upload-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(124,58,237,0.4); }

/* Preview */
.age-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.age-canvas { max-width: 100%; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); border: 2px solid #ddd6fe; }
.age-retry-btn {
    background: #f5f3ff; color: #7c3aed; border: 2px solid #ddd6fe;
    border-radius: 10px; padding: 10px 22px; font-size: 14px;
    font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.age-retry-btn:hover { background: #ede9fe; border-color: #7c3aed; }

/* Right — Results */
.age-right { min-height: 280px; }

/* Processing */
.age-processing {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 50px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.age-proc-spinner {
    width: 50px; height: 50px;
    border: 5px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.age-proc-text { font-size: 16px; font-weight: 600; color: #374151; }

/* No Face */
.age-no-face {
    background: #fff5f5;
    border: 2px solid #fca5a5;
    border-radius: 16px;
    padding: 36px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.age-no-face strong { font-size: 18px; color: #7f1d1d; }
.age-no-face p      { font-size: 14px; color: #6b7280; max-width: 280px; line-height: 1.6; }

/* Placeholder */
.age-placeholder {
    background: #f8fafc;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
}
.age-placeholder-icon { font-size: 48px; margin-bottom: 12px; }
.age-placeholder-text { font-size: 16px; font-weight: 700; color: #374151; margin-bottom: 18px; }
.age-placeholder-tips { display: flex; flex-direction: column; gap: 8px; text-align: left; max-width: 240px; margin: 0 auto; }
.age-tip { font-size: 13px; color: #4b5563; }

/* Result Cards */
.age-results-title {
    font-size: 16px; font-weight: 800; color: #1f2937;
    margin-bottom: 14px;
}

.age-face-card {
    background: #fff;
    border: 2px solid #ddd6fe;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(124,58,237,0.1);
}

.age-face-card-header {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.age-face-num      { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.8); }
.age-top-emotion   { font-size: 14px; font-weight: 800; color: #fff; }

/* Big Stats */
.age-big-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #f0f0f0;
    border-bottom: 2px solid #f3f4f6;
}

.age-stat-age, .age-stat-gender {
    background: #fff;
    padding: 20px 16px;
    text-align: center;
}

.age-stat-num   { font-size: 52px; font-weight: 900; color: #7c3aed; line-height: 1; }
.age-stat-unit  { font-size: 13px; color: #6b7280; margin-top: 4px; }
.age-stat-group { font-size: 14px; font-weight: 700; color: #374151; margin-top: 6px; background: #f5f3ff; display: inline-block; padding: 3px 12px; border-radius: 20px; }

.age-gender-val  { font-size: 22px; font-weight: 800; color: #1f2937; margin-bottom: 6px; }
.age-gender-conf { font-size: 13px; color: #6b7280; background: #f3f4f6; display: inline-block; padding: 3px 10px; border-radius: 20px; }

/* Emotions */
.age-emotions-section { padding: 16px; }
.age-emotions-title   { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 10px; }

.age-emotion-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.age-emotion-label     { font-size: 12px; font-weight: 600; color: #374151; width: 90px; flex-shrink: 0; }
.age-emotion-bar-track { flex: 1; height: 8px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.age-emotion-bar-fill  { height: 100%; border-radius: 999px; transition: width 0.8s ease; }
.age-emotion-pct       { font-size: 12px; font-weight: 700; color: #374151; width: 32px; text-align: right; flex-shrink: 0; }

/* Info Box */
.info-box { background: linear-gradient(135deg, #faf5ff, #ede9fe); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.info-box h4 { color: #4c1d95; font-size: 20px; margin-bottom: 18px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.info-item { background: #fff; border-radius: 12px; padding: 16px; color: #374151; font-size: 14px; line-height: 1.6; }
.info-item strong { display: block; color: #7c3aed; font-size: 14px; font-weight: 700; margin-bottom: 4px; }

/* Responsive */
@media (max-width: 860px) {
    .age-main { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .age-upload-zone  { padding: 36px 16px; min-height: 220px; }
    .age-big-stats    { grid-template-columns: 1fr; }
    .age-stat-num     { font-size: 40px; }
    .info-grid        { grid-template-columns: 1fr; }
}