/* Premium Glassmorphism & Dark Mode Style for PG Web Administration Panel */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(20, 26, 45, 0.6);
    --bg-card-hover: rgba(28, 36, 61, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1; /* Indigo */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent: #14b8a6; /* Teal */
    --accent-gradient: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    --danger: #ef4444; /* Rose */
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    --warning: #f59e0b; /* Amber */
    
    --sidebar-width: 280px;
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-logo svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active a {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.db-info-pill {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.db-info-pill span {
    display: block;
    color: var(--text-secondary);
}

.db-info-pill strong {
    color: var(--accent);
    word-break: break-all;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.navbar {
    height: 70px;
    background: rgba(11, 15, 25, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
}

.content-container {
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Cards */
.card-premium {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.card-premium:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 15px 35px -10px rgba(99, 102, 241, 0.15);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Dashboard Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.3);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metric-icon.indigo { background: var(--primary-gradient); }
.metric-icon.teal { background: var(--accent-gradient); }
.metric-icon.danger { background: var(--danger-gradient); }
.metric-icon.warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.metric-details span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

.metric-details strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

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

.form-input option {
    background-color: #111625;
    color: var(--text-primary);
}

.form-input.code-style {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: #0f1322;
}

/* Premium Buttons */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

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

.btn-premium.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-premium.accent {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn-premium.accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(20, 184, 166, 0.5);
}

.btn-premium.danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-premium.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.btn-premium.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-premium.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-premium-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Premium Table Grid */
.table-responsive-premium {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

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

.table-premium th {
    background: rgba(15, 23, 42, 0.8);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-premium td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

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

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

/* SQL Query Execution Panel */
.sql-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #0d111d;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.sql-editor-header {
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sql-textarea {
    width: 100%;
    height: 220px;
    background: transparent;
    border: none;
    padding: 1.25rem;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

/* Badges */
.badge-premium {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-premium.primary { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-premium.accent { background: rgba(20, 184, 166, 0.15); color: #99f6e4; border: 1px solid rgba(20, 184, 166, 0.3); }
.badge-premium.danger { background: rgba(239, 68, 68, 0.15); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Pager / Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.pagination-list {
    display: flex;
    gap: 0.35rem;
    list-style: none;
}

.pagination-item a, .pagination-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 0 0.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.pagination-item.active a {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.pagination-item a:hover:not(.active) {
    background: rgba(255,255,255,0.07);
    color: white;
}

/* Toast/Alerts */
.alert-premium {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.alert-premium.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.alert-premium.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Connection Screen Portal */
.login-body {
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 40%),
                radial-gradient(circle at 90% 80%, rgba(20, 184, 166, 0.1) 0%, rgba(0, 0, 0, 0) 50%),
                #070a13;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    font-family: var(--font-sans);
    padding: 1.5rem;
}

.login-card {
    max-width: 480px;
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

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

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo {
    width: 65px;
    height: 65px;
    margin: 0 auto;
    background: var(--primary-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.login-logo svg {
    width: 38px;
    height: 38px;
    fill: white;
}
