/* ==========================================================================
   Daniel Tattoo Official - Admin Panel CSS
   ========================================================================== */

:root {
    --bg-dark: #0b0b0b;
    --bg-card: #141414;
    --bg-card-hover: #1c1c1c;
    --bg-input: #1a1a1a;
    --border-color: #282828;
    --border-focus: #d4af37;
    --gold-primary: #d4af37;
    --gold-hover: #f3cf55;
    --text-main: #f5f5f5;
    --text-muted: #9e9e9e;
    --danger: #e74c3c;
    --danger-hover: #c0392b;
    --success: #2ecc71;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s ease;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- LOGIN OVERLAY --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.1);
}

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

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.login-header h2 span {
    color: var(--gold-primary);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

/* --- TOPBAR --- */
.topbar {
    height: 65px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: none;
}

.topbar .brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.topbar .brand span {
    color: var(--gold-primary);
}

.topbar .brand small {
    font-family: var(--font-body);
    font-size: 0.75rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.db-badge {
    font-size: 0.8rem;
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, 0.2);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

/* --- LAYOUT & SIDEBAR --- */
.admin-layout {
    display: flex;
    margin-top: 65px;
    min-height: calc(100vh - 65px);
}

.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 65px;
    bottom: 0;
    left: 0;
    z-index: 900;
    transition: var(--transition);
}

.sidebar-nav ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-nav li {
    margin-bottom: 0.3rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.08);
    border-left-color: var(--gold-primary);
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    max-width: 1400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.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-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.section-header-admin p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--gold-hover);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

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

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

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-outline-danger:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--danger);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1rem;
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-group.half { flex: 1; }
.form-group.third { flex: 1; }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.form-section-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--gold-primary);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- FILTER BAR --- */
.admin-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.pill.active, .pill:hover {
    background: var(--gold-primary);
    color: #000;
    border-color: var(--gold-primary);
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding-left: 2.5rem;
}

/* --- CARDS & GRIDS --- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.portfolio-card-admin {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.portfolio-card-admin:hover {
    border-color: var(--gold-primary);
    transform: translateY(-4px);
}

.portfolio-thumb {
    width: 100%;
    height: 180px;
    position: relative;
    background: #000;
    overflow: hidden;
}

.portfolio-thumb img, .portfolio-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--gold-primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: capitalize;
    backdrop-filter: blur(4px);
}

.portfolio-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.portfolio-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    word-break: break-word;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-actions button {
    flex: 1;
}

/* --- SERVICES & ITEMS LIST --- */
.services-list-admin, .reviews-list-admin, .faqs-list-admin {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: var(--transition);
}

.admin-item-card:hover {
    border-color: var(--border-focus);
}

.admin-item-left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: 1;
}

.item-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--gold-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.item-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.item-details p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- FORM CARDS --- */
.admin-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- FILE DROPZONE --- */
.file-input-hidden {
    display: none;
}

.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.05);
}

.file-dropzone i {
    font-size: 2rem;
    color: var(--gold-primary);
}

.file-dropzone small {
    color: var(--text-muted);
}

.media-preview-container {
    margin-top: 1rem;
    display: none;
}

.media-preview-container img, .media-preview-container video {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

/* --- DATABASE CONFIG STATUS --- */
.db-status-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.db-status-icon {
    font-size: 2.5rem;
    color: var(--gold-primary);
}

.db-status-info h3 span {
    color: var(--gold-primary);
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 10000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--gold-primary);
    color: var(--text-main);
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast i {
    color: var(--gold-primary);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle-btn {
        display: block;
    }
    .main-content {
        margin-left: 0;
        padding: 1.2rem;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
