@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: rgba(6, 182, 212, 0.4);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --color-cyan: #06b6d4;
    --color-indigo: #6366f1;
    --color-emerald: #10b981;
    --color-rose: #f43f5e;
    --color-amber: #f59e0b;

    --gradient-brand: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.06), 0 4px 12px -4px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 0 20px 0 rgba(6, 182, 212, 0.08);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --sidebar-width: 260px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--color-indigo);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(6, 182, 212, 0.2); }
    50% { box-shadow: 0 0 30px rgba(6, 182, 212, 0.4); }
}

/* Common Layout Containers */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand img {
    height: 32px;
    width: auto;
}

.sidebar-brand span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-profile {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-cyan);
}

.sidebar-profile .profile-info {
    display: flex;
    flex-direction: column;
}

.sidebar-profile .profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.sidebar-profile .profile-status {
    font-size: 0.75rem;
    color: var(--color-emerald);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-profile .profile-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-emerald);
    border-radius: 50%;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-left: 12px;
    margin-bottom: 4px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.menu-item a:hover,
.menu-item.active a {
    background-color: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
}

.menu-item.active a {
    border-left: 3px solid var(--color-cyan);
    background-color: rgba(6, 182, 212, 0.08);
    color: var(--color-cyan);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background-color: var(--color-rose);
    color: white;
}

/* Main Content Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    transition: var(--transition-smooth);
}

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

.header-title h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Modern Card Layouts */
.glass-card {
    background: var(--bg-card);
    background-image: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
    animation: fadeIn 0.4s ease-out;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

/* Grid Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-cyan);
    font-size: 1.5rem;
}

.stat-card:nth-child(2) .stat-icon {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--color-indigo);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: var(--color-rose);
    color: white;
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
    background-color: #ffffff;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-text {
    font-size: 0.85rem;
    color: var(--color-rose);
}

/* Modern styled tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background-color: #f8fafc;
    padding: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.custom-table tbody tr {
    transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
    background-color: rgba(15, 23, 42, 0.015);
}

.table-token-cell {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background-color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    word-break: break-all;
}

.table-qr-img {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.table-qr-img:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

/* Captcha Block */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-img {
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.btn-refresh-captcha {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: #f1f5f9;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-refresh-captcha:hover {
    background-color: #e2e8f0;
    color: var(--color-cyan);
}

/* Alert/Toast Messages */
.alert-box {
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--color-rose);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-emerald);
}

/* Login Page Layout */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-header {
    text-align: center;
}

.login-header img {
    height: 64px;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* Public Verification Layout */
.verification-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.verification-card {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.verification-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.valid {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.invalid {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.shield-icon {
    font-size: 4rem;
    line-height: 1;
}

.shield-icon.valid {
    color: var(--color-emerald);
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.3));
}

.shield-icon.invalid {
    color: var(--color-rose);
    filter: drop-shadow(0 0 15px rgba(244, 63, 94, 0.3));
}

.verification-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 8px;
}

.verification-details-table {
    width: 100%;
    border-collapse: collapse;
}

.verification-details-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.verification-details-table td:first-child {
    font-weight: 600;
    color: var(--text-secondary);
    width: 35%;
}

.verification-details-table td:last-child {
    color: var(--text-primary);
}

/* Mobile Hamburger Menu */
.hamburger-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-overlay {
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .hamburger-toggle {
        display: block;
    }
    
    .mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-smooth);
    }
    
    .mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 600px) {
    .header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .btn {
        width: 100%;
    }
    
    .custom-table thead {
        display: none;
    }
    
    .custom-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 16px;
        background-color: #ffffff;
    }
    
    .custom-table td {
        padding: 8px 0;
        border: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .custom-table td::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .table-token-cell {
        word-break: break-all;
    }
    
    .table-qr-img {
        max-width: 120px;
    }
}

/* Active/Inactive Status Badge Colors */
.status-badge.active-status {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.inactive-status {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Dropzone styling for client-side hash match */
.dropzone-container {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dropzone-container.dragover {
    border-color: var(--color-cyan);
    background-color: rgba(6, 182, 212, 0.03);
    box-shadow: var(--shadow-glow);
}

.dropzone-icon {
    font-size: 2rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.dropzone-container:hover .dropzone-icon {
    color: var(--color-cyan);
    transform: translateY(-2px);
}

.verification-result-box {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease-out;
}

.verification-result-box.match {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-emerald);
    display: flex;
}

.verification-result-box.mismatch {
    background-color: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--color-rose);
    display: flex;
}

/* Toggle switch styling */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

input:checked + .slider {
    background-color: var(--color-cyan);
    border-color: var(--color-cyan);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: #ffffff;
}

/* Modal details list styling */
.logs-table td {
    padding: 12px 16px !important;
}

.ip-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
}
