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

:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --primary: #58a6ff;
    --primary-hover: #3182ce;
    --glass-bg: rgba(22, 27, 34, 0.6);
    --glass-border: rgba(240, 246, 252, 0.1);
    --danger: #f85149;
    --success: #2ea043;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Background gradient animation */
.login-bg {
    background: linear-gradient(-45deg, #0d1117, #161b22, #0d1a2b, #120e1a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h2 {
    color: #fff;
    font-weight: 600;
}

.logo p {
    color: #8b949e;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #e6edf3;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.btn {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-danger { background-color: transparent; border: 1px solid rgba(248, 81, 73, 0.5); color: var(--danger); padding: 0.5rem 1rem;}
.btn-danger:hover { background-color: rgba(248, 81, 73, 0.1); border-color: var(--danger); }

.btn-block {
    width: 100%;
    display: block;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

.alert-danger {
    background: rgba(248, 81, 73, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.alert-success {
    background: rgba(46, 160, 67, 0.1);
    color: var(--success);
    border: 1px solid rgba(46, 160, 67, 0.4);
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    border-right: 1px solid var(--glass-border);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    background: rgba(22, 27, 34, 0.4);
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left: 3px solid var(--primary);
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    color: #fff;
}

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

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    font-weight: 500;
    color: #8b949e;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.action-links a {
    color: var(--primary);
    text-decoration: none;
    margin-right: 0.5rem;
}

.action-links a:hover {
    text-decoration: underline;
}

/* Modal Simple */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal {
    width: 100%;
    max-width: 500px;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: #8b949e;
}

.modal-body {
    padding: 1.5rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-local { background: rgba(88, 166, 255, 0.1); color: var(--primary); border: 1px solid rgba(88, 166, 255, 0.2); }
.badge-global { background: rgba(46, 160, 67, 0.1); color: var(--success); border: 1px solid rgba(46, 160, 67, 0.2); }

canvas { max-width: 100%; }

/* Mobile Header */
.mobile-header {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-header h2 {
    color: #fff;
    font-size: 1.3rem;
    margin: 0;
    font-weight: 600;
}

.mobile-menu-btn {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary);
    line-height: 1;
    user-select: none;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .dashboard-layout {
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        display: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        background: var(--bg-color); /* solid background on mobile so it doesn't clash */
    }
    
    .sidebar.active {
        display: flex;
    }
    
    .sidebar-header h2 {
        display: none; /* Hide duplicate logo text */
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header > div {
        width: 100%;
        justify-content: flex-start;
    }
    
    .grid-cards {
        grid-template-columns: 1fr;
    }
    
    .modal {
        max-width: 95%;
        margin: 1rem;
    }
    
    /* Make search forms stack nicely */
    .card form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .card form input, 
    .card form select, 
    .card form button, 
    .card form a {
        width: 100%;
        text-align: center;
    }
}
