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

:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #0f0f1b 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-glow: rgba(99, 102, 241, 0.15);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background decorative glows */
.glow-orb {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
    z-index: -1;
    filter: blur(50px);
}

.glow-orb-1 {
    top: 10%;
    left: 15%;
}

.glow-orb-2 {
    bottom: 10%;
    right: 15%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0) 70%);
}

/* Glassmorphism Container */
.glass-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                0 0 50px var(--accent-glow);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

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

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s ease-in-out;
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

.input-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    margin-top: 12px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: none;
}

/* Toggle Switch Styling */
.toggle-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    margin: 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.toggle-info {
    text-align: left;
}

.toggle-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-transform: none;
}

.toggle-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Custom Checkbox Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

input:checked + .slider {
    background-color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px var(--danger-glow);
}

input:checked + .slider:before {
    transform: translateX(28px);
}

/* Status Indicator */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.stopped {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.status-badge.active .status-dot {
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

.status-badge.stopped .status-dot {
    box-shadow: 0 0 8px #ef4444;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Footer / API Link area */
.info-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.info-footer a:hover {
    color: #818cf8;
    text-decoration: underline;
}

/* Dashboard User-Management Responsive Layouts */
.dashboard-container {
    max-width: 1100px;
    width: 95%;
    margin: 40px auto;
    animation: fadeIn 0.6s ease-out;
}

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

.header-title-section h1 {
    margin-bottom: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-sm {
    padding: 10px 18px;
    font-size: 0.9rem;
    border-radius: 10px;
    width: auto;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 20px var(--danger-glow);
}

/* Glassmorphic Users Table */
.table-responsive {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

.users-table th, .users-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    vertical-align: middle;
}

.users-table th {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

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

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

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Table Inline Controls */
.inline-expiry-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-control-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    width: auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.input-control-sm:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 10px var(--danger-glow);
}

/* Premium Dialog Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-container {
    background: #121222;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    padding: 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(99, 102, 241, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: left;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    background: #16162a;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

/* Sidebar Admin Panel Layout */
.admin-panel-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at 80% 20%, #171732 0%, #0c0c16 100%);
    position: relative;
}

.sidebar {
    width: 260px;
    background: rgba(10, 10, 22, 0.7);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
}

.sidebar-logo-icon {
    font-size: 1.5rem;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--primary);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: calc(100% - 260px);
}

/* Statistics Metrics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3),
                0 0 15px rgba(99, 102, 241, 0.05);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Advanced Table Filters and Actions Row */
.table-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-filter-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-control {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    width: 240px;
    transition: var(--transition);
}

.search-input-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.filter-select {
    padding: 10px 16px;
    background: rgba(20, 20, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    border-color: var(--primary);
}

/* Pagination Bar */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
}

.page-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

