/* Project: AerosEdge Admin Command Center 
    File: css/admin.css 
*/

:root {
    --bg-base: #020204;
    --bg-deep-blue: #050a15;
    --bg-deep-purple: #0a0410;
    --accent-cyan: #00e5ff;
    --accent-purple: #8b5cf6;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --neon-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* --- RESET & CORE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 25px;
}

/* --- BACKGROUND ANIMATION --- */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 20% 80%, var(--bg-deep-blue), transparent 60%),
        radial-gradient(circle at 80% 20%, var(--bg-deep-purple), transparent 70%);
}

/* --- TEXT & TITLES --- */
.text-gradient {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), #3b82f6, var(--accent-cyan));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textLiquidShine 4s linear infinite;
}

@keyframes textLiquidShine {
    to {
        background-position: 200% center;
    }
}

/* --- BUTTONS --- */
.btn-edge {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.btn-cyan {
    background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
    box-shadow: var(--neon-shadow);
}

.btn-cyan:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
    transform: rotate(5deg);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 15px;
    border-radius: 8px;
    transition: 0.3s;
}

.btn-danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* --- CARDS & HOVER EFFECTS --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px 30px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-decoration: none;
    color: inherit;
    overflow: visible;
    /* CRITICAL: Allows dropdowns to show outside the box */
    z-index: 1;
}

.card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.1);
    z-index: 1000;
    /* THE FIX: Brings hovered card and its dropdown to the very front */
}

.card h3 {
    color: var(--accent-cyan);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 800;
}

.card p {
    font-size: 2.2rem;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
}

.card>i {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 2.5rem;
    opacity: 0.1;
    color: var(--accent-cyan);
    transition: 0.4s;
}

.card:hover>i {
    opacity: 0.4;
    transform: scale(1.2) rotate(-10deg);
}

/* --- DROPDOWNS --- */
.card-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 15px;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid var(--accent-cyan);
    border-radius: 18px;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

.card:hover .card-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    transition: 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 18px;
    color: var(--accent-cyan);
}

/* --- FORM STYLES --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-purple);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.form-control {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: 0.4s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

/* --- TABLES --- */
.user-list {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.user-list td {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    transition: 0.3s;
}

.user-list tr td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: 15px 0 0 15px;
}

.user-list tr td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 15px 15px 0;
}

.user-list tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
}

/* --- CHATBOT LOGS --- */
.chat-logs-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.chat-log-container {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 15px;
}

.chat-log-item {
    padding: 25px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 4px 18px 18px 18px;
    border-left: 4px solid var(--accent-purple);
    display: inline-block;
    align-self: flex-start;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
}

.chat-user-tag {
    color: var(--accent-cyan);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

/* --- ALERTS --- */
.alert {
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 700;
    border-left: 5px solid transparent;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-color: #22c55e;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: #ef4444;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}
/* --- HEADER ALIGNMENT --- */
.header {
    display: flex;
    justify-content: space-between; /* This pushes title to left and buttons to right */
    align-items: center;           /* Vertically centers them on the same line */
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- TITLE STYLE --- */
.header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: #b8b8ff; /* Soft lavender color from your image */
    margin: 0;
}

/* --- BUTTON GROUP --- */
.header-actions {
    display: flex;
    gap: 12px; /* Space between the two buttons */
    align-items: center;
}

/* --- NEON MANAGE CONTENT BUTTON --- */
.btn-manage {
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: white;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    transition: 0.3s;
    border: none;
}

.btn-manage:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.6);
}

/* --- POWER OFF BUTTON --- */
.btn-power {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.2);
    color: #ff4d4d;
    padding: 10px 15px;
    border-radius: 10px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-power:hover {
    background: #ff4d4d;
    color: white;
}
/* Enhanced Table Styling for Sub-Admin List */
.user-list {
    border-collapse: separate;
    border-spacing: 0 12px; /* Adds space between "rows" to make them look like cards */
}

.user-list tr td {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 20px;
    transition: 0.3s ease;
}

.user-list tr td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: 15px 0 0 15px;
}

.user-list tr td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 15px 15px 0;
}

/* Hover effect for sub-admin items */
.user-list tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
    transform: scale(1.01);
}
.card:hover { 
    z-index: 1000 !important; 
}
/* IICEA SEO Panel Styles */
.iicea-seo-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    font-family: system-ui, -apple-system, sans-serif;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 350px;
}
/* IICEA SEO Dashboard Styles */
.iicea-admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: system-ui, -apple-system, sans-serif;
    color: #334155;
}

.seo-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.seo-dash-header h2 {
    margin: 0;
    color: #0f172a;
}

.btn-scan {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-scan:hover { background: #1d4ed8; }

/* Metrics Grid */
.seo-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.metric-card h4 {
    margin: 0 0 10px 0;
    color: #64748b;
    font-size: 14px;
    text-transform: uppercase;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    color: #1e293b;
}
.metric-value.green { color: #16a34a; }
.metric-value.yellow { color: #ca8a04; }
.metric-value.red { color: #dc2626; }

/* Data Table */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.seo-table th, .seo-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.seo-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.score-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}
.score-badge.green { background: #dcfce7; color: #16a34a; }
.score-badge.yellow { background: #fef08a; color: #ca8a04; }
.score-badge.red { background: #fee2e2; color: #dc2626; }

.btn-edit {
    text-decoration: none;
    color: #2563eb;
    font-weight: bold;
}
.btn-edit:hover { text-decoration: underline; }