/* ==================== Admin Panel CSS ==================== */
:root {
    --admin-bg-primary: #0a0a0f;
    --admin-bg-secondary: #14141f;
    --admin-bg-tertiary: #1c1c2e;

    --admin-text-primary: #ffffff;
    --admin-text-secondary: #a0a0b8;
    --admin-text-muted: #6b6b8a;

    --admin-accent: #8b5cf6;
    --admin-accent-hover: #9d70f7;
    --admin-success: #10b981;
    --admin-error: #ef4444;
    --admin-warning: #f59e0b;

    --admin-border: rgba(139, 92, 246, 0.2);
    --admin-border-light: rgba(139, 92, 246, 0.1);

    --gradient-admin: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--admin-bg-primary);
    color: var(--admin-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==================== Login Screen ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(28, 28, 46, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--admin-border);
    border-radius: 1.5rem;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* Stylized Text Logo - EPILEF */
.logo-wrapper {
    display: inline-flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: -1px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
    transition: all 0.3s ease;
}

.logo-wrapper.large {
    padding: 12px 24px;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.logo-bracket {
    color: var(--admin-accent);
}

.logo-text-main {
    color: white;
    margin: 0 4px;
    background: var(--gradient-admin);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-slash {
    color: #06b6d4;
    margin-right: 2px;
}

.logo-wrapper.large .logo-text-main {
    font-size: 2.2rem;
}

.logo-wrapper.large .logo-bracket {
    font-size: 2.4rem;
}


.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-admin);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text-secondary);
}

.form-input {
    padding: 0.875rem 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--admin-border-light);
    border-radius: 0.75rem;
    color: var(--admin-text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
    color: var(--admin-text-muted);
}

.login-error {
    padding: 0.875rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.75rem;
    color: var(--admin-error);
    font-size: 0.875rem;
    text-align: center;
}

.btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-admin);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.back-link {
    color: var(--admin-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--admin-accent);
}

/* ==================== Admin Dashboard ==================== */
.admin-container {
    min-height: 100vh;
    background: var(--admin-bg-primary);
}

.admin-header {
    background: var(--admin-bg-secondary);
    border-bottom: 1px solid var(--admin-border-light);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-wrapper.small {
    padding: 6px 12px;
}

.logo-wrapper.small .logo-text-main {
    font-size: 1.1rem;
}

.logo-wrapper.small .logo-bracket {
    font-size: 1.2rem;
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--admin-border-light);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.btn-secondary {
    background: rgba(139, 92, 246, 0.1);
    color: var(--admin-text-primary);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--admin-accent);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.admin-layout {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    width: 280px;
    background: var(--admin-bg-secondary);
    border-right: 1px solid var(--admin-border-light);
    padding: 2rem 1rem;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 100px;
}

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: var(--admin-text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-link:hover {
    background: rgba(139, 92, 246, 0.05);
    color: var(--admin-text-primary);
}

.nav-link.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--admin-accent);
    border-color: var(--admin-border);
}

.nav-icon {
    font-size: 1.25rem;
}

.admin-main {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.admin-section-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-section-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-section {
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-light);
    border-radius: 1rem;
    padding: 2rem;
}

.section-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header-admin h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* ==================== Loading & Empty States ==================== */
.loading-state,
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--admin-text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--admin-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ==================== Table ==================== */
.table-container {
    overflow-x: auto;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--admin-bg-tertiary);
    border-radius: 0.75rem;
    overflow: hidden;
}

.projects-table thead {
    background: rgba(139, 92, 246, 0.1);
}

.projects-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.projects-table td {
    padding: 1rem;
    border-top: 1px solid var(--admin-border-light);
    color: var(--admin-text-primary);
}

.projects-table tbody tr {
    transition: background 0.3s ease;
}

.projects-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-visible {
    background: rgba(16, 185, 129, 0.2);
    color: var(--admin-success);
    border: 1px solid var(--admin-success);
}

.status-hidden {
    background: rgba(107, 107, 138, 0.2);
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-text-muted);
}

.featured-badge {
    font-size: 1.25rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 300px;
}

.tech-tag-small {
    padding: 0.125rem 0.5rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--admin-border);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--admin-accent);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    background: rgba(139, 92, 246, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==================== Modal ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border);
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--admin-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--admin-text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--admin-text-primary);
}

.modal-form,
.modal-body {
    padding: 2rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    margin-top: 0.25rem;
}

.form-textarea {
    padding: 0.875rem 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--admin-border-light);
    border-radius: 0.75rem;
    color: var(--admin-text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.form-textarea:focus {
    outline: none;
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-select {
    padding: 0.875rem 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--admin-border-light);
    border-radius: 0.75rem;
    color: var(--admin-text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select:focus {
    outline: none;
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--admin-accent);
}

.image-upload-group {
    position: relative;
}

.form-input-file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.file-label {
    display: block;
    padding: 0.875rem 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--admin-border-light);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-label:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--admin-border);
}

.image-preview {
    margin-top: 1rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--admin-border-light);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--admin-border-light);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-danger {
    background: var(--admin-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.warning-text {
    color: var(--admin-warning);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--admin-border-light);
        padding: 1rem;
    }

    .sidebar-nav {
        flex-direction: row;
        top: 0;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        white-space: nowrap;
        justify-content: center;
    }

    .admin-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }

    .admin-main {
        padding: 1rem;
    }

    .admin-section {
        padding: 1rem;
    }

    .section-header-admin {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .projects-table {
        font-size: 0.8rem;
    }

    .projects-table th,
    .projects-table td {
        padding: 0.75rem 0.25rem;
    }

    .tech-tags {
        max-width: 100px;
    }

    .modal-content {
        width: 95%;
    }

    .modal-form,
    .modal-body {
        padding: 1.5rem;
    }
}

/* ==================== Settings Section ==================== */
.settings-content {
    max-width: 600px;
    margin: 0 auto;
}

.settings-card {
    background: var(--admin-bg-tertiary);
    border: 1px solid var(--admin-border-light);
    border-radius: 1rem;
    padding: 2.5rem;
}

.settings-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--admin-text-primary);
}

.settings-desc {
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .settings-card {
        padding: 1.5rem;
    }
}