/* ========================================
   ADMIN PANEL STYLES
   Dark Modern Dashboard
   ======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-1: #7c3aed;
    --accent-2: #06b6d4;
    --accent-3: #f43f5e;
    --gradient-1: linear-gradient(135deg, #7c3aed, #06b6d4);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

/* === Login Screen === */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        var(--bg-primary);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(20px);
}
.login-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.logo-bracket { color: var(--text-muted); }
.logo-text { color: var(--accent-2); }
.logo-dot { color: var(--accent-1); }
.logo-suffix { color: var(--text-secondary); }
.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.login-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}
.input-group input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.input-group input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.toggle-pass {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
}
.login-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-1);
    color: white;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}
.login-error {
    color: var(--accent-3);
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* === Admin Layout === */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}
.sidebar-logo {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    font-family: var(--font-primary);
    text-align: left;
}
.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sidebar-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}
.sidebar-link.active {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-2);
    font-weight: 600;
}
.sidebar-link .badge {
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent-3);
    color: white;
}
.sidebar-link .badge.dev {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.logout-btn:hover {
    background: rgba(244, 63, 94, 0.1) !important;
    color: var(--accent-3) !important;
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* === Top Bar === */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}
.page-title {
    font-size: 1.3rem;
    font-weight: 700;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

/* === Content Sections === */
.content-section {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}
.content-section.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}
.stat-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.stat-card-icon.purple { background: rgba(124, 58, 237, 0.15); color: var(--accent-1); }
.stat-card-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-2); }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-card-icon.pink { background: rgba(244, 63, 94, 0.15); color: var(--accent-3); }
.stat-card-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}
.stat-card-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Admin Card === */
.admin-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    margin-bottom: 1.5rem;
}
.admin-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* === Quick Actions === */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: var(--text-primary);
    transform: translateY(-2px);
}
.action-btn.danger:hover {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--accent-3);
}
.action-btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* === Messages === */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.message-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}
.message-item:hover {
    border-color: rgba(124, 58, 237, 0.2);
}
.message-item.full {
    flex-wrap: wrap;
}
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.message-avatar.alt { background: linear-gradient(135deg, #06b6d4, #10b981); }
.message-avatar.warm { background: linear-gradient(135deg, #7c3aed, #f43f5e); }
.message-content { flex: 1; min-width: 0; }
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.message-header strong { font-size: 0.9rem; }
.msg-email {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 0.5rem;
}
.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.message-subject {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-2);
    margin-bottom: 0.25rem;
}
.message-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.message-meta { margin-bottom: 0.5rem; }
.meta-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-2);
}
.message-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-3);
    color: white;
    white-space: nowrap;
}
.message-actions {
    display: flex;
    gap: 0.5rem;
}
.mark-read:hover { color: #10b981 !important; border-color: rgba(16, 185, 129, 0.3) !important; }
.delete-msg:hover { color: var(--accent-3) !important; border-color: rgba(244, 63, 94, 0.3) !important; }

/* === Section Header Bar === */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header-bar h3 {
    font-size: 1.2rem;
    font-weight: 700;
}
.msg-count {
    font-size: 0.8rem;
    color: var(--accent-3);
    font-weight: 600;
}
.dev-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    font-weight: 600;
}
.add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-1);
    color: white;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.add-btn svg { width: 16px; height: 16px; }
.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* === CMS Form === */
.cms-form {
    margin-top: 1rem;
}
.cms-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.cms-form .form-group {
    margin-bottom: 1rem;
}
.cms-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cms-form input,
.cms-form textarea,
.cms-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.cms-form input:focus,
.cms-form textarea:focus,
.cms-form select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.mono-input {
    font-family: var(--font-mono) !important;
    font-size: 0.85rem !important;
}
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.save-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-1);
    color: white;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.cancel-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.cancel-btn:hover {
    background: var(--bg-glass);
}
.test-btn {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.test-btn:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}

/* === Image Upload === */
.image-upload-area {
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.image-upload-area:hover {
    border-color: var(--accent-1);
    background: rgba(124, 58, 237, 0.05);
}
.image-upload-area svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.image-upload-area p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.image-upload-area span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Projects Table === */
.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
}
.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition);
}
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--bg-glass); }
.project-name {
    font-weight: 500;
    font-size: 0.9rem;
}
.table-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-1);
}
.table-badge.alt { background: rgba(6, 182, 212, 0.15); color: var(--accent-2); }
.table-badge.warm { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.table-actions {
    display: flex;
    gap: 0.5rem;
}
.edit-btn, .delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}
.edit-btn svg, .delete-btn svg { width: 14px; height: 14px; }
.edit-btn:hover { color: var(--accent-2); border-color: rgba(6, 182, 212, 0.3); }
.delete-btn:hover { color: var(--accent-3); border-color: rgba(244, 63, 94, 0.3); }

/* === Developer Section Cards === */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.card-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-3);
    font-weight: 600;
}
.card-status.connected {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}
.card-desc a {
    color: var(--accent-2);
    text-decoration: none;
}
.card-desc a:hover { text-decoration: underline; }

/* === Data Actions === */
.data-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === Toast Notification === */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}
.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(244, 63, 94, 0.3); }

/* === Responsive === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-menu-btn {
        display: block;
    }
    .cms-form .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .content-section {
        padding: 1rem;
    }
    .table-header,
    .table-row {
        grid-template-columns: 1fr 1fr;
    }
    .table-header span:nth-child(3),
    .table-row span:nth-child(3) {
        display: none;
    }
    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    .overlay.active {
        display: block;
    }
}

/* === Profile Photo Upload === */
.profile-upload-area {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}
.profile-preview-wrapper {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.1));
    border: 2px solid var(--border-glass);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}
.profile-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}
.profile-upload-actions {
    flex: 1;
    min-width: 200px;
}
.profile-photo-btns {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.card-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
@media (max-width: 768px) {
    .profile-upload-area {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-photo-btns {
        justify-content: center;
    }
}
