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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000000;
    min-height: 100vh;
    padding: 20px;
    color: #e8e8e8;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: left;
    color: #ffffff;
    margin-bottom: 35px;
    padding: 20px 0;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    font-size: 0.95rem;
    color: #8a8f98;
    font-weight: 400;
}

/* Validation Section */
.validation-section {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
}

.validation-section h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.csv-import {
    margin-bottom: 20px;
}

.file-label {
    display: inline-block;
    cursor: pointer;
    margin-right: 10px;
}

.csv-status {
    background: rgba(74, 157, 111, 0.2);
    border: 1px solid rgba(74, 157, 111, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.csv-status p {
    color: #5aad7f;
    font-weight: 600;
}

/* Statistics Panel */
.stats-panel {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 100px;
    background: rgba(42, 47, 74, 0.5);
    border: 1px solid rgba(74, 95, 138, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #8a8f98;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-scanned {
    border-left: 3px solid #5a7fbb;
}

.stat-unique {
    border-left: 3px solid #4a9d6f;
}

.stat-duplicate {
    border-left: 3px solid #f5a623;
}

.stat-unexpected {
    border-left: 3px solid #e74c3c;
}

/* Scanner Section */
.scanner-section {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
    text-align: center;
}

.scanner-section h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Camera Selection */
.camera-selection {
    text-align: left;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(42, 47, 74, 0.4);
    border-radius: 12px;
}

.camera-selection label {
    display: block;
    color: #7a8faa;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.camera-select {
    width: 100%;
    padding: 12px;
    background: rgba(20, 24, 42, 0.8);
    border: 1px solid rgba(74, 95, 138, 0.3);
    border-radius: 8px;
    color: #e8e8e8;
    font-size: 0.95rem;
    cursor: pointer;
}

.camera-select:focus {
    outline: none;
    border-color: #5a7fbb;
}

.permission-status {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
}

.permission-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

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

#permissionText {
    color: #c8d0d8;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.permission-help {
    background: rgba(74, 95, 138, 0.2);
    border: 1px solid rgba(74, 95, 138, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.permission-help h3 {
    color: #ff6b6b;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.permission-help p {
    color: #c8d0d8;
    margin-bottom: 15px;
    line-height: 1.6;
}

.permission-help ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.permission-help ul li {
    color: #c8d0d8;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(42, 47, 74, 0.4);
    border-radius: 8px;
    border-left: 3px solid #5a7fbb;
    line-height: 1.5;
}

#reader {
    max-width: 100%;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    font-size: 0.95rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    margin: 5px;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #4a6fa5 0%, #5a7fbb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.5);
    background: linear-gradient(135deg, #5a7fbb 0%, #6a8fcb 100%);
}

.btn-secondary {
    background: rgba(58, 66, 86, 0.8);
    color: #e8e8e8;
    border: 1px solid rgba(74, 95, 138, 0.3);
}

.btn-secondary:hover {
    background: rgba(68, 76, 96, 0.9);
    transform: translateY(-2px);
    border-color: rgba(74, 95, 138, 0.5);
}

/* Manual Input Section */
.manual-input-section {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
}

.manual-input-section h2 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-description {
    color: #8a8f98;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.manual-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(20, 24, 42, 0.8);
    border: 2px solid rgba(74, 95, 138, 0.3);
    border-radius: 12px;
    color: #e8e8e8;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.manual-input:focus {
    outline: none;
    border-color: #5a7fbb;
    background: rgba(20, 24, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(90, 127, 187, 0.1);
}

.manual-input::placeholder {
    color: #6a7585;
}

/* Result Section */
.result-section {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
}

.result-section h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.result-card {
    background: rgba(42, 47, 74, 0.5);
    border: 1px solid rgba(74, 95, 138, 0.15);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 700;
}

.validation-icon {
    font-size: 2rem;
}

.unique-icon {
    filter: drop-shadow(0 0 8px rgba(74, 157, 111, 0.5));
}

.duplicate-icon {
    filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.5));
}

.unexpected-icon {
    filter: drop-shadow(0 0 8px rgba(155, 89, 182, 0.5));
}

.error-icon {
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.5));
}

.unique-text {
    color: #4a9d6f;
    background: rgba(74, 157, 111, 0.2);
    padding: 18px;
    border-radius: 12px;
    flex: 1;
    text-align: center;
    border: 2px solid rgba(74, 157, 111, 0.4);
}

.duplicate-text {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.2);
    padding: 18px;
    border-radius: 12px;
    flex: 1;
    text-align: center;
    border: 2px solid rgba(245, 166, 35, 0.4);
}

.unexpected-text {
    color: #9b59b6;
    background: rgba(155, 89, 182, 0.2);
    padding: 18px;
    border-radius: 12px;
    flex: 1;
    text-align: center;
    border: 2px solid rgba(155, 89, 182, 0.4);
}

.error-text {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    padding: 18px;
    border-radius: 12px;
    flex: 1;
    text-align: center;
    border: 2px solid rgba(231, 76, 60, 0.5);
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    }
}

.result-item {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(74, 95, 138, 0.2);
}

.result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-item label {
    display: block;
    font-weight: 600;
    color: #7a8faa;
    margin-bottom: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    display: block;
    color: #e8e8e8;
    font-size: 1rem;
    word-break: break-all;
    line-height: 1.5;
}

.content-box {
    background: rgba(20, 24, 42, 0.6);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(74, 95, 138, 0.2);
    max-height: 200px;
    overflow-y: auto;
}

.duplicate-info {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    color: #f5a623;
    text-align: center;
}

/* History Section */
.history-section {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
}

.history-section h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    background: rgba(42, 47, 74, 0.6);
    border: 1px solid rgba(74, 95, 138, 0.3);
    border-radius: 8px;
    color: #c8d0d8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-btn:hover {
    background: rgba(52, 57, 84, 0.8);
    border-color: rgba(74, 95, 138, 0.5);
}

.filter-btn.active {
    background: linear-gradient(135deg, #4a6fa5 0%, #5a7fbb 100%);
    border-color: #5a7fbb;
    color: #ffffff;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: rgba(42, 47, 74, 0.4);
    border: 1px solid rgba(74, 95, 138, 0.2);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(42, 47, 74, 0.6);
    border-color: rgba(74, 95, 138, 0.4);
    transform: translateX(4px);
}

.history-item.unique {
    border-left: 3px solid #4a9d6f;
}

.history-item.duplicate {
    border-left: 3px solid #f5a623;
}

.history-item.unexpected {
    border-left: 3px solid #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unique-badge {
    background: rgba(74, 157, 111, 0.2);
    color: #4a9d6f;
    border: 1px solid rgba(74, 157, 111, 0.4);
}

.duplicate-badge {
    background: rgba(245, 166, 35, 0.2);
    color: #f5a623;
    border: 1px solid rgba(245, 166, 35, 0.4);
}

.unexpected-badge {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.history-item-time {
    font-size: 0.75rem;
    color: #6a7585;
}

.history-item-content {
    color: #c8d0d8;
    word-break: break-all;
    font-size: 0.9rem;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    color: #6a7585;
    font-style: italic;
    padding: 20px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.notification-success {
    background: linear-gradient(135deg, #4a9d6f 0%, #5aad7f 100%);
    box-shadow: 0 8px 24px rgba(74, 157, 111, 0.4);
    border: 1px solid rgba(90, 173, 127, 0.3);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.6);
    border: 1px solid rgba(231, 76, 60, 0.5);
    font-size: 1.05rem;
}

/* Legacy support */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4a9d6f 0%, #5aad7f 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(74, 157, 111, 0.4);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid rgba(90, 173, 127, 0.3);
    backdrop-filter: blur(10px);
    font-weight: 600;
}

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

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

    .validation-section, .scanner-section, .manual-input-section, .result-section, .history-section {
        padding: 20px;
    }

    .stats-panel {
        flex-direction: column;
    }

    .stat-item {
        min-width: 100%;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .input-group {
        flex-direction: column;
    }

    .manual-input {
        width: 100%;
    }

    .history-filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 31, 58, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 95, 138, 0.6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(90, 127, 187, 0.8);
}
