/* Poll Voter Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --warning-gradient: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-card: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 50%, #0f1419 100%);
    min-height: 100vh;
    color: var(--text-primary);
    direction: rtl;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.login-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-header p { color: var(--text-secondary); }
.login-logo {
    width: 80px; height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 20px rgba(17, 153, 142, 0.4);
}
.login-footer { text-align: center; margin-top: 1.5rem; color: var(--text-muted); font-size: 0.85rem; }

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand { display: flex; align-items: center; gap: 1rem; }
.navbar-brand h1 { font-size: 1.4rem; }
.navbar-brand small { color: var(--text-secondary); font-size: 0.8rem; }
.brand-logo {
    width: 45px; height: 45px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.nav-tabs { display: flex; gap: 0.5rem; }
.nav-tab {
    padding: 0.7rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.9rem;
}
.nav-tab:hover, .nav-tab.active {
    background: rgba(17, 153, 142, 0.2);
    color: #38ef7d;
}

/* Main */
.main-container { padding: 2rem; max-width: 1500px; margin: 0 auto; }
.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem; color: #38ef7d; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.2);
}

.stat-icon {
    width: 55px; height: 55px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}
.stat-icon.purple { background: var(--secondary-gradient); }
.stat-icon.green { background: var(--success-gradient); }
.stat-icon.yellow { background: var(--warning-gradient); }
.stat-icon.blue { background: var(--info-gradient); }

.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { color: var(--text-secondary); font-size: 0.85rem; }

/* Data Section */
.data-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.section-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; color: #38ef7d; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 0.9rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}
.data-table th { color: var(--text-secondary); font-weight: 500; font-size: 0.85rem; }
.data-table tbody tr:hover { background: rgba(17, 153, 142, 0.1); }

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}
.card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 10px 30px rgba(17, 153, 142, 0.15);
    border-color: rgba(56, 239, 125, 0.3);
}
.card.running { border-color: rgba(56, 239, 125, 0.5); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.card-title { font-size: 1.1rem; font-weight: 600; }
.card-info { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.card-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Badge */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge.online { background: var(--success-gradient); }
.badge.offline { background: rgba(255, 255, 255, 0.2); }

/* Buttons */
.btn {
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary-gradient); color: white; }
.btn-success { background: var(--success-gradient); color: white; }
.btn-danger { background: var(--danger-gradient); color: white; }
.btn-warning { background: var(--warning-gradient); color: #333; }
.btn-info { background: var(--info-gradient); color: white; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: white; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.4rem; font-size: 1rem; }

.btn-delete {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}
.btn-delete:hover { background: var(--danger-gradient); color: white; }

/* Actions Bar */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.actions-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Note Box */
.note-box {
    background: rgba(17, 153, 142, 0.15);
    border: 1px solid rgba(17, 153, 142, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.note-box code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; }
.note-box.success { background: rgba(56, 239, 125, 0.15); border-color: rgba(56, 239, 125, 0.3); }
.note-box.warning { background: rgba(247, 151, 30, 0.15); border-color: rgba(247, 151, 30, 0.3); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 1.75rem;
    max-width: 450px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1.2rem; font-weight: 600; color: #38ef7d; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }

/* Form */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.4rem; color: var(--text-secondary); font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}
.form-control:focus { outline: none; border-color: #38ef7d; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

/* Checkbox List */
.checkbox-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
}
.checkbox-item:hover { background: rgba(17, 153, 142, 0.1); }
.checkbox-item input { width: 18px; height: 18px; cursor: pointer; accent-color: #38ef7d; }
.checkbox-item label { cursor: pointer; flex: 1; }

/* Logs */
.logs-box {
    background: #000;
    color: #38ef7d;
    padding: 1.25rem;
    border-radius: 10px;
    max-height: 450px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid #38ef7d; }
.toast.error { border-left: 4px solid #f45c43; }
.toast.info { border-left: 4px solid #4facfe; }

/* Poll Card */
.poll-card {
    background: rgba(17, 153, 142, 0.1);
    border: 1px solid rgba(17, 153, 142, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.poll-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: #38ef7d; }
.poll-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}
.poll-choice:hover { background: rgba(17, 153, 142, 0.2); }
.poll-choice.selected { background: rgba(56, 239, 125, 0.3); border: 1px solid #38ef7d; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 1rem; }
    .nav-tabs { flex-wrap: wrap; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: rgba(56, 239, 125, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(56, 239, 125, 0.5); }
