/* --------------------------------------------------------------------------
   ASHRAYA TRUST - PREMIUM ADMIN DASHBOARD STYLES
   -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
    --primary: #0A4D44;
    --primary-dark: #062E29;
    --primary-light: #12665B;
    --accent: #E29A13;
    --accent-hover: #b45309;
    --accent-light: #fef3c7;
    --accent-gold: #f59e0b;
    
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --success: #10b981;
    --success-light: #d1fae5;
    --info: #0284c7;
    --info-light: #e0f2fe;
    
    --sidebar-width: 270px;
    --header-height: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.brand-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #ffffff;
}

.brand-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.75px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(226, 154, 19, 0.2);
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 3px;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.75rem 0.85rem 0.35rem 0.85rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    font-size: 0.925rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item:hover i {
    color: var(--accent);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(226, 154, 19, 0.25) 0%, rgba(226, 154, 19, 0.05) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid var(--accent);
}

.nav-item.active i {
    color: var(--accent);
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-meta h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.user-meta span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.btn-logout-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-logout-icon:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

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

/* Top Header */
.admin-topbar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

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

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.page-title-box h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.page-title-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.btn-visit-site {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--border-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-visit-site:hover {
    background: #e2e8f0;
    color: var(--primary-dark);
}

/* Page Body Container */
.admin-content {
    flex: 1;
    padding: 2rem;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card.card-teal::after { background: var(--primary); }
.stat-card.card-gold::after { background: var(--accent); }
.stat-card.card-blue::after { background: var(--info); }
.stat-card.card-green::after { background: var(--success); }

.stat-info h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-info p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.card-teal .stat-icon { background: rgba(10, 77, 68, 0.1); color: var(--primary); }
.card-gold .stat-icon { background: rgba(226, 154, 19, 0.12); color: var(--accent); }
.card-blue .stat-icon { background: var(--info-light); color: var(--info); }
.card-green .stat-icon { background: var(--success-light); color: var(--success); }

/* Main Card Container */
.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.dashboard-card-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: #ffffff;
}

.dashboard-card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dashboard-card-body {
    padding: 1.75rem;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(10, 77, 68, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(10, 77, 68, 0.35);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(226, 154, 19, 0.25);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-hover), #92400e);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--border-subtle);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Filter Bar Tabs */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    background: var(--border-subtle);
    padding: 0.35rem;
    border-radius: var(--radius-md);
    width: fit-content;
}

.filter-tab {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover {
    color: var(--primary);
}

.filter-tab.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.form-label span.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
    font-family: inherit;
    color: var(--text-primary);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 77, 68, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-hint {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Custom Dropzone / Upload Box */
.dropzone-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    background: #f8fafc;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dropzone-box:hover, .dropzone-box.drag-over {
    border-color: var(--primary);
    background: rgba(10, 77, 68, 0.03);
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.dropzone-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.dropzone-sub {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.dropzone-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Image preview in upload */
.preview-container {
    display: none;
    margin-top: 1rem;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 240px;
    border: 1px solid var(--border-color);
}

.preview-container img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.preview-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

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

/* ==========================================================================
   GALLERY & VIDEO ITEMS GRID
   ========================================================================== */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.media-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.media-thumb-wrap {
    position: relative;
    height: 190px;
    background: #0f172a;
    overflow: hidden;
}

.media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.media-card:hover .media-thumb {
    transform: scale(1.05);
}

.media-badge-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(10, 77, 68, 0.88);
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.media-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(226, 154, 19, 0.92);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
    cursor: pointer;
}

.media-card:hover .media-video-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--accent);
}

.media-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.media-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.media-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 1rem;
    flex: 1;
}

.media-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.media-action-btns {
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   MODALS & ALERTS
   ========================================================================== */

.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

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

.modal-close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.75rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

/* Flash alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.925rem;
    font-weight: 500;
    animation: alertSlide 0.3s ease;
}

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

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   LOGIN PAGE SPECIFIC STYLES
   ========================================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #041c19 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 440px;
    padding: 2.75rem 2.25rem;
    position: relative;
    z-index: 10;
}

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

.login-logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.login-logo h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle-btn {
        display: block;
    }
}

@media (max-width: 640px) {
    .admin-content {
        padding: 1.25rem;
    }

    .admin-topbar {
        padding: 0 1.25rem;
    }

    .media-grid {
        grid-template-columns: 1fr;
    }
}
