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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
    --success: #10b981;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent),
        radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.1), transparent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    width: 100%;
    display: none;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Glassmorphism Header */
/* Glassmorphism Header */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 0.8rem;
    list-style: none;
    margin: 0;
}

.nav-item {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.nav-item:active {
    transform: translateY(1px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-secondary:hover {
    background: #ef4444 !important;
    color: white !important;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sections */
section {
    display: none;
    animation: fadeIn 0.5s ease;
}

section.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Cards */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-left: 3rem;
}

.toggle-password {
    position: absolute;
    left: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
}

.toggle-password:hover {
    color: var(--primary);
}

.btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: var(--glass);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--glass);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.qr-box {
    background: white;
    padding: 1rem;
    border-radius: 16px;
    margin: 1.5rem auto;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-box img {
    width: 100%;
    height: 100%;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

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

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

select option {
    background-color: #1e293b;
    color: white;
}

/* Icons */
i {
    font-style: normal;
}

[dir="rtl"] {
    text-align: right;
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    vertical-align: text-bottom;
    margin-inline-end: 0.5rem;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}