/* =====================================================
   GLOBAL STYLES
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Arial', 'Segoe UI', sans-serif;
    background: #f4f4f4;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 15px 0;
    color: #111;
}

h1 {
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1 i {
    color: goldenrod;
}

h2 {
    font-size: 22px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2 i {
    color: goldenrod;
    margin-right: 8px;
}

/* =====================================================
   LOGIN PAGE
===================================================== */
.login-body {
    background: linear-gradient(135deg, #111 0%, #2c2c2c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px 30px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-logo {
    width: 120px;
    margin-bottom: 20px;
    border-radius: 10px;
}

.login-box h2 {
    color: goldenrod;
    margin-bottom: 25px;
    font-size: 26px;
}

.login-box input {
    width: 100%;
    padding: 12px 15px;
    margin: 12px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-box input:focus {
    outline: none;
    border-color: goldenrod;
    box-shadow: 0 0 0 3px rgba(218,165,32,0.1);
}

.login-box button {
    width: 100%;
    background: goldenrod;
    border: none;
    padding: 12px;
    color: #111;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.login-box button:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.forgot-link {
    display: block;
    margin-top: 15px;
    font-size: 14px;
    color: goldenrod;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #b8860b;
}

/* =====================================================
   TOPBAR (MOBILE)
===================================================== */
.topbar {
    display: none;
    background: #000;
    color: #fff;
    padding: 14px 18px;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.topbar span {
    font-size: 18px;
    font-weight: bold;
    color: goldenrod;
}

.menu-btn {
    background: none;
    border: none;
    color: goldenrod;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    transform: scale(1.1);
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, goldenrod 0%, #b8860b 100%);
    position: fixed;
    padding: 20px;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.sidebar h2 {
    color: #fff;
    margin: 0;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: none;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    padding: 14px 12px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #fff;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar a:hover {
    background: rgba(0,0,0,0.2);
    transform: translateX(5px);
}

.sidebar a:hover::before {
    transform: scaleY(1);
}

.sidebar a i {
    font-size: 18px;
    min-width: 20px;
}

/* ACTIVE MENU */
.sidebar a.active {
    background: #000;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.sidebar a.active::before {
    transform: scaleY(1);
}

.sidebar a.active i {
    color: goldenrod;
}

/* =====================================================
   MAIN CONTENT AREA
===================================================== */
.main {
    margin-left: 260px;
    padding: 30px;
    max-width: calc(100% - 260px);
    min-height: 100vh;
}

/* PAGE SUBTITLE */
.page-subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

/* =====================================================
   DASHBOARD STATS
===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: linear-gradient(135deg, #111 0%, #2c2c2c 100%);
    color: #fff;
    padding: 30px 25px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(218,165,32,0.1) 0%, transparent 70%);
    transition: all 0.5s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(218,165,32,0.3);
}

.stat-card:hover::before {
    top: -100%;
    right: -100%;
}

.stat-card h3 {
    color: goldenrod;
    font-size: 36px;
    margin: 0 0 10px 0;
    position: relative;
    z-index: 1;
}

.stat-card p {
    font-size: 14px;
    margin: 0;
    color: #ccc;
    position: relative;
    z-index: 1;
}

/* QUICK CARD */
.quick-card {
    background: #fff;
    padding: 25px;
    border-left: 5px solid goldenrod;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* =====================================================
   BUTTONS
===================================================== */
.btn-gold {
    background: goldenrod;
    color: #111;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(218,165,32,0.3);
}

.btn-gold:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.btn-gold i {
    font-size: 16px;
}

.edit-btn {
    display: inline-block;
    padding: 8px 14px;
    background: goldenrod;
    color: #111;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease;
    text-align: center;
}

.edit-btn:hover {
    background: #b8860b;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(218,165,32,0.4);
}

.edit-btn i {
    margin-right: 5px;
}

.delete-btn {
    display: inline-block;
    padding: 8px 14px;
    background: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(220,53,69,0.4);
}

.delete-btn i {
    margin-right: 5px;
}

/* =====================================================
   UPLOAD FORM STYLES
===================================================== */
.upload-form {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 !important;
    color: #222;
}

.form-group input,
.form-group select,
.form-group textarea {
     !padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="file"] {
    padding: 10px;
    cursor: pointer;
    border: 2px dashed #ddd;
    background: #f9f9f9;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
    font-size: 13px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: goldenrod;
    box-shadow: 0 0 0 3px rgba(218,165,32,0.15);
    outline: none;
    background: #fff;
}

.form-group small {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.upload-form button {
    grid-column: 1 / -1;
    background: goldenrod;
    color: #111;
    border: none;
    padding: 14px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.upload-form button:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.upload-form button i {
    font-size: 16px;
}

/* =====================================================
   MEDIA GRID & CARDS
===================================================== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
    margin-top: 30px;
}

.media-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.media-preview {
    width: 100%;
    height: 200px;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.media-info {
    margin-top: 12px;
    text-align: center;
}

.badge {
    display: inline-block;
    background: goldenrod;
    color: #111;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.file-name {
    font-weight: 600;
    color: #111;
    margin: 8px 0;
    font-size: 15px;
}

.media-info small {
    color: #666;
    font-size: 13px;
}

.media-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-preview {
    background: #111;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-preview:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.btn-preview i {
    font-size: 14px;
}

/* =====================================================
   PREVIEW MODAL
===================================================== */
.preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.preview-content {
    background: #111;
    padding: 25px;
    max-width: 95%;
    max-height: 95%;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

#previewBody {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(218,165,32,0.3);
}

.close-preview {
    position: absolute;
    top: 10px;
    right: 15px;
    color: goldenrod;
    font-size: 32px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-preview:hover {
    background: goldenrod;
    color: #111;
    transform: rotate(90deg);
}

/* =====================================================
   TABLE STYLES (DESKTOP)
===================================================== */
.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.media-table {
    width: 100%;
    border-collapse: collapse;
}

.media-table thead {
    background: goldenrod;
    color: #111;
}

.media-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 2px solid #b8860b;
}

.media-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.media-table tbody tr {
    transition: all 0.3s ease;
}

.media-table tbody tr:hover {
    background: #f9f9f9;
}

.thumb {
    width: 90px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* =====================================================
   MOBILE CARDS (ALTERNATIVE TO TABLE)
===================================================== */
.mobile-cards {
    display: none;
}

/* =====================================================
   RESPONSIVE DESIGN
===================================================== */
@media(max-width: 768px) {
    /* TOPBAR VISIBLE */
    .topbar {
        display: flex;
    }

    /* SIDEBAR HIDDEN BY DEFAULT */
    .sidebar {
        left: -260px;
    }

    .sidebar.open {
        left: 0;
    }

    .close-btn {
        display: block;
    }

    /* MAIN CONTENT FULL WIDTH */
    .main {
        margin-left: 0;
        max-width: 100%;
        padding: 20px 15px;
    }

    /* HIDE TABLE, SHOW CARDS */
    .table-wrapper {
        display: none;
    }

    .mobile-cards {
        display: grid;
    }

    /* STATS GRID */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* MEDIA GRID */
    .media-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    /* FORM ADJUSTMENTS */
    .upload-form {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 15px;
    }

    .upload-form button {
        grid-column: 1;
        font-size: 14px;
        padding: 12px;
    }

    /* HEADINGS */
    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
        margin-top: 25px;
    }

    /* PREVIEW MODAL */
    .preview-content {
        padding: 15px;
        max-width: 98%;
    }

    .close-preview {
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

@media(max-width: 480px) {
    .sidebar {
        width: 220px;
        padding: 15px;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar a {
        font-size: 14px;
        padding: 12px 10px;
    }

    .media-actions {
        flex-direction: column;
    }

    .media-actions a,
    .media-actions button {
        justify-content: center !important;
        width: 100%;
    }
        /* FORM ADJUSTMENTS */
    .upload-form {
        grid-template-columns: 200px !important;
        padding: 20px;
        gap: 15px;
    }
}

/* =====================================================
   UTILITY CLASSES
===================================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* =====================================================
   SCROLLBAR STYLING
===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: goldenrod;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/* =====================================================
   BADGE VARIANTS
===================================================== */
.badge-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.badge-project {
    background: goldenrod;
    color: #111;
}

.badge-media {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

/* =====================================================
   MEDIA TYPE BADGE
===================================================== */
.media-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-top: 6px;
}

.media-type-badge i {
    font-size: 10px;
}

/* =====================================================
   EDIT PAGE SPECIFIC STYLES
===================================================== */
.danger-zone {
    background: #fff3f3;
    border-left: 5px solid #dc3545;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
}

.danger-zone h2 {
    color: #dc3545;
}

.danger-zone p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Back Button */
.btn-gold i[class*="arrow"] {
    margin-right: 8px;
}

/* Current Media Preview in Edit */
.quick-card .media-preview {
    max-width: 100%;
    margin: 0 auto;
}

/* Form spacing in edit page */
.upload-form + .upload-form {
    margin-top: 0;
}

/* =====================================================
   STATUS BADGES
===================================================== */
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.status-active {
    background: #28a745;
    color: #fff;
}

.status-inactive {
    background: #dc3545;
    color: #fff;
}

.status-completed {
    background: #17a2b8;
    color: #fff;
}

.status-pending {
    background: #ffc107;
    color: #111;
}

/* =====================================================
   IMPROVED STAT CARDS WITH ICONS
===================================================== */
.stat-card p i {
    margin-right: 5px;
    color: goldenrod;
}

/* =====================================================
   QUICK ACTIONS BUTTONS
===================================================== */
.quick-card .btn-gold {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* =====================================================
   SECTION ICONS
===================================================== */
.fa-home { color: #007bff; }
.fa-info-circle { color: #17a2b8; }
.fa-cogs { color: #ffc107; }
.fa-wrench { color: #6c757d; }
.fa-building { color: #28a745; }
.fa-star { color: #fd7e14; }

/* =====================================================
   DASHBOARD HEADINGS
===================================================== */
h1 i, h2 i {
    color: goldenrod;
    margin-right: 10px;
}

/* =====================================================
   MEDIA INFO IMPROVEMENTS
===================================================== */
.media-info small {
    display: block;
    margin-top: 5px;
    line-height: 1.5;
}

.media-info .fa-location-dot {
    color: goldenrod;
    margin-right: 3px;
}

/* =====================================================
   SYSTEM INFO SECTION
===================================================== */
.quick-card h3 {
    font-size: 2rem;
}

/* =====================================================
   RESPONSIVE DASHBOARD
===================================================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .stat-card p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    
}