/**
 * QR Face - Styles
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Loading/Verification screen */
#loading-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

#loading-screen h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #fff;
}

#loading-screen p {
    color: #aaa;
    font-size: 0.9rem;
}

.verify-logo {
    color: #4ecca3;
    margin-bottom: 20px;
}

.verify-subtitle {
    color: #888;
    margin-bottom: 30px;
}

.verify-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px 40px;
    margin: 20px 0;
    max-width: 350px;
}

.verify-status {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.verify-hint {
    color: #888;
    font-size: 0.8rem;
}

.verify-footer {
    margin-top: 40px;
}

.verify-footer p {
    font-size: 0.8rem;
    color: #666;
}

.verify-footer strong {
    color: #4ecca3;
}

.verify-legal {
    font-size: 0.7rem;
    color: #555;
    margin-top: 5px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-left-color: #4ecca3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Camera screen */
#camera-screen {
    padding: 0;
    background: #000;
    position: relative;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.camera-frame {
    width: 200px;
    height: 250px;
    border: 3px solid rgba(78, 204, 163, 0.8);
    border-radius: 120px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

.camera-hint {
    color: #fff;
    font-size: 0.9rem;
    margin-top: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#camera-screen video {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    transform: scaleX(-1);
}

/* Result page */
.result-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-header {
    text-align: center;
    margin-bottom: 15px;
}

.result-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.result-header.success {
    color: #e74c3c;
}

.result-header.failure {
    color: #4ecca3;
}

/* Compact captured summary */
.captured-summary {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.captured-image-small {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.captured-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.captured-data {
    flex: 1;
    min-width: 0;
}

.captured-intro {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.captured-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: #ccc;
}

.captured-list li {
    margin-bottom: 4px;
}

.captured-list strong {
    color: #fff;
}

.data-collected {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.data-collected.compact {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
}

.data-collected.compact p {
    margin: 0;
}

.data-collected h2 {
    font-size: 0.9rem;
    color: #e74c3c;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.data-item:last-child {
    border-bottom: none;
}

.data-item .label {
    color: #888;
}

.data-item .value {
    color: #fff;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.warning-box {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 15px;
}

.warning-box h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.warning-box p {
    font-size: 0.85rem;
    opacity: 0.95;
    margin-bottom: 10px;
}

.warning-box ul {
    margin-left: 18px;
    font-size: 0.85rem;
}

.warning-box li {
    margin-bottom: 5px;
    opacity: 0.9;
}

.warning-takeaway {
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.success-box {
    background: linear-gradient(135deg, #4ecca3 0%, #2ecc71 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #1a1a2e;
}

.success-box h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.success-box p {
    font-size: 0.9rem;
    margin: 0;
}

.applause {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Stats page */
.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.stats-header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.stats-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stats-header p {
    color: #888;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.stat-card.danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.2) 100%);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.stat-card.success {
    background: linear-gradient(135deg, rgba(78, 204, 163, 0.2) 0%, rgba(46, 204, 113, 0.2) 100%);
    border: 1px solid rgba(78, 204, 163, 0.3);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card.danger .stat-number {
    color: #e74c3c;
}

.stat-card.success .stat-number {
    color: #4ecca3;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-percent {
    font-size: 1.2rem;
    margin-top: 5px;
    opacity: 0.8;
}

/* Chart sections */
.chart-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.chart-section h2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #fff;
}

.chart-subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-top: -15px;
    margin-bottom: 20px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-row.thirds {
    grid-template-columns: repeat(3, 1fr);
}

.chart-row .chart-section {
    margin-bottom: 0;
}

.chart-row .chart-section.half {
    margin-bottom: 0;
}

/* Bar charts */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 80px;
    font-size: 0.85rem;
    color: #aaa;
    flex-shrink: 0;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.bar-value {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

/* Hourly chart */
.hourly-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 4px;
    padding-top: 10px;
}

.hour-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    cursor: pointer;
}

.hour-fill {
    width: 100%;
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    margin-top: auto;
    transition: height 0.3s ease;
}

.hour-bar:hover .hour-fill {
    background: linear-gradient(180deg, #ff6b5b 0%, #e74c3c 100%);
}

.hour-label {
    font-size: 0.7rem;
    color: #666;
    margin-top: 5px;
}

/* Map */
.map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.map-container .leaflet-control-attribution {
    font-size: 10px;
}

/* QR Page */
.qr-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.qr-container h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #fff;
}

.qr-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.qr-code {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.qr-code img {
    display: block;
    width: 220px;
    height: 220px;
}

.qr-url {
    color: #666;
    font-size: 0.8rem;
    word-break: break-all;
    margin-bottom: 20px;
}

.qr-instructions {
    max-width: 320px;
    margin-bottom: 30px;
}

.qr-instructions p {
    color: #888;
    font-size: 0.85rem;
    line-height: 1.5;
}

.nav-link-subtle {
    color: #555;
    font-size: 0.8rem;
    margin-top: 20px;
}

.nav-link-subtle:hover {
    color: #4ecca3;
}

/* Links */
.nav-link {
    display: inline-block;
    margin-top: 30px;
    color: #4ecca3;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .chart-row.thirds {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-number {
        font-size: 2rem;
    }

    .chart-row {
        grid-template-columns: 1fr;
    }

    .bar-label {
        width: 60px;
        font-size: 0.75rem;
    }

    .hourly-chart {
        height: 100px;
    }

    .hour-label {
        font-size: 0.6rem;
    }

    .map-container {
        height: 300px;
    }
}
