/* ==========================================================================
   Modern Dark Glassmorphism Design System
   ========================================================================== */

:root {
    --bg-dark: #090a15;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-border: rgba(255, 255, 255, 0.2);
    
    /* Neon gradients & Brand Colors */
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    --secondary-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --accent-glow: 0 0 25px rgba(124, 58, 237, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    --font-primary: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Glowing Blobs */
.background-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.circle-1 {
    top: -10%;
    right: 5%;
    width: 450px;
    height: 450px;
    background: #6366f1;
    animation: float 20s ease-in-out infinite alternate;
}

.circle-2 {
    bottom: -10%;
    left: 5%;
    width: 450px;
    height: 450px;
    background: #a855f7;
    animation: float 15s ease-in-out infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

/* Center layouts */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Glassmorphism Container */
.glass-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 580px;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-container:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

/* Header & Fonts */
.font-outfit {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(120deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 30px;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.input-glass {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    outline: none;
}

.input-glass::placeholder {
    color: var(--text-muted);
}

.input-glass:focus {
    border-color: #a855f7;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    font-family: inherit;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--accent-glow);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.btn-glow:hover::after {
    transform: translate(50%, 50%) rotate(30deg);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Alert Boxes */
.alert-box {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    text-align: left;
    border-left: 4px solid transparent;
}

.info-alert {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-info);
    color: #93c5fd;
}

.danger-alert {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: #fca5a5;
}

.warning-alert {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--color-warning);
    color: #fcd34d;
}

.success-alert {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-success);
    color: #6ee7b7;
}

/* Vertical Button Group */
.button-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.button-group-vertical .btn {
    width: 100%;
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 24px;
}

/* Error/Access Denied Card specific */
.error-card {
    max-width: 500px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

/* Result Section */
.result-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    animation: fadeIn 0.4s ease forwards;
}

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

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-container {
    display: flex;
    gap: 10px;
}

.copy-container input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.08);
}

/* Navigation Dashboard layout */
.dashboard-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 16px 32px;
    margin-bottom: 30px;
}

.brand {
    font-size: 1.5rem;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

/* Dashboard Body Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 350px 1fr;
    }
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
}

.dashboard-card h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}

/* Custom Table Layout */
.table-container {
    overflow-x: auto;
    width: 100%;
}

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

.custom-table th {
    padding: 16px;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Table Link Styling */
.table-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table-link:hover {
    color: #a855f7;
    text-decoration: underline;
}

.table-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.table-action-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: -300px;
    background: rgba(16, 185, 129, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(10px);
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.toast.show {
    right: 24px;
}

.text-center {
    text-align: center;
}
.font-semibold {
    font-weight: 600;
}
.text-xs {
    font-size: 0.75rem;
}
.text-muted {
    color: var(--text-muted);
}
.truncate {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ==========================================================================
   QR Code Modal Styling (Premium overlay and content zoom effects)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 10, 21, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 440px;
    padding: 35px 30px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--color-danger);
}

/* ==========================================================================
   Pagination Controls Styling (Glassmorphism Pagination buttons)
   ========================================================================== */
.pagination-btn {
    background: var(--secondary-gradient);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--card-hover-border);
    transform: translateY(-1px);
}

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

.pagination-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.35);
}


