/**
 * User Info Detector - Dark Mode Stylesheet
 */

:root {
    /* Dark Theme Colors */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e2139;
    --bg-hover: #252850;

    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;

    --border-color: #2d2d44;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);

    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Consent Banner */
.consent-banner {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.consent-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
    margin: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

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

.consent-content h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--accent-primary);
}

.consent-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.consent-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.consent-details h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.consent-details ul {
    list-style: none;
    margin-bottom: 16px;
}

.consent-details li {
    padding: 8px 0;
    color: var(--text-secondary);
}

.warning {
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    padding: 12px;
    border-radius: var(--radius);
    border-left: 3px solid var(--accent-warning);
}

.consent-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.privacy-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 20px;
}

/* Main Content */
.main-content {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 60px;
}

header h1 {
    font-size: 48px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Container */
.container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Control Panel */
.control-panel {
    text-align: center;
    margin-bottom: 40px;
}

.export-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius);
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-panel.active {
    display: block;
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 24px;
}

.info-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.info-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.info-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    word-break: break-word;
}

.info-value.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.info-value.hash {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Fonts List */
.fonts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.font-tag {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

/* Uniqueness Bar */
.uniqueness-bar {
    background: var(--bg-hover);
    border-radius: 20px;
    height: 40px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.uniqueness-fill {
    background: linear-gradient(90deg, var(--accent-success), var(--accent-warning), var(--accent-error));
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: width 1s ease-out;
}

.uniqueness-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-error);
    border-radius: var(--radius);
    padding: 24px;
    color: var(--text-primary);
}

.error-message h3 {
    color: var(--accent-error);
    margin-bottom: 12px;
}

.error-message ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.error {
    color: var(--accent-error);
}

/* Raw Data */
#rawData {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Privacy Section */
.privacy-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-top: 60px;
    box-shadow: var(--shadow);
}

.privacy-section h2 {
    font-size: 32px;
    margin-bottom: 24px;
    color: var(--accent-primary);
}

.privacy-content h3 {
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.privacy-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.disclaimer {
    margin-top: 12px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 14px;
    }

    .container {
        padding: 20px;
    }

    /* Consent Banner Mobile */
    .consent-banner {
        padding: 10px;
        align-items: flex-start;
    }

    .consent-content {
        padding: 20px;
        margin: 10px 0;
        max-height: none;
        border-radius: var(--radius);
    }

    .consent-content h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .consent-content p {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .consent-details {
        padding: 16px;
        margin: 16px 0;
    }

    .consent-details h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .consent-details ul {
        font-size: 13px;
    }

    .consent-details li {
        padding: 6px 0;
    }

    .warning {
        font-size: 13px;
        padding: 10px;
    }

    .consent-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .privacy-link {
        font-size: 13px;
        text-align: center;
        display: block;
    }

    /* Main Content Mobile */
    .info-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    .export-buttons {
        flex-direction: column;
    }

    /* Stats Cards Mobile */
    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        font-size: 28px;
        width: 50px;
        height: 50px;
    }

    .stat-info h3 {
        font-size: 12px;
    }

    .stat-value {
        font-size: 16px;
    }

    /* Privacy Section Mobile */
    .privacy-section {
        padding: 24px 20px;
    }

    .privacy-section h2 {
        font-size: 24px;
    }

    .privacy-content h3 {
        font-size: 18px;
    }

    .privacy-content p {
        font-size: 14px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .consent-content {
        padding: 16px;
    }

    .consent-content h2 {
        font-size: 20px;
    }

    .consent-details {
        padding: 12px;
    }

    header h1 {
        font-size: 28px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .control-panel {
        margin-bottom: 24px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
