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

:root {
    --primary: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #f9fafb;
    --bg-alt: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg: #111827;
    --bg-alt: #1f2937;
    --text: #f3f4f6;
    --text-light: #d1d5db;
    --border: #374151;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.theme-toggle {
    display: flex;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* MAIN */
.main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* UPLOAD SECTION */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-alt);
    transition: all 0.3s ease;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--primary);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background-color: rgba(37, 99, 235, 0.15);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2), var(--shadow-lg);
    transform: scale(1.02);
}

.upload-icon {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-zone h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.upload-zone p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

/* ACTION BUTTONS */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #d1d5db;
    box-shadow: var(--shadow);
}

.btn-text {
    display: inline;
}

.loader {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn:not(:disabled) .loader {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .loader {
    display: block;
}

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

/* RESULTS SECTION */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.file-card {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.file-card.error {
    border-left: 4px solid var(--error);
}

.file-card.success {
    border-left: 4px solid var(--success);
}

.file-card.warning {
    border-left: 4px solid var(--warning);
}

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

.file-icon {
    font-size: 2rem;
    min-width: 2.5rem;
    text-align: center;
}

.file-name {
    flex: 1;
    word-break: break-word;
}

.file-name strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.file-size {
    color: var(--text-light);
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-ext {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
}

.info-value {
    color: var(--text);
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
    word-break: break-word;
}

.magika-section {
    background-color: var(--bg);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.magika-section h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.magika-type {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.confidence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confidence-bar {
    flex: 1;
    height: 6px;
    background-color: var(--border);
    border-radius: 3px;
    overflow: hidden;
    max-width: 100px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning), var(--success));
    transition: width 0.3s ease;
}

.verification {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verification.match {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.verification.mismatch {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.verification.suspicious {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* FOOTER */
.footer {
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
    margin-top: auto;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer small {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.success {
    background-color: var(--success);
}

.toast.error {
    background-color: var(--error);
}

.toast.warning {
    background-color: var(--warning);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .main {
        padding: 1rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .upload-zone h2 {
        font-size: 1.2rem;
    }

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

    .file-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-value {
        margin-left: 0;
        margin-top: 0.25rem;
        text-align: left;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .footer {
        padding: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
