/* admin.css - Compact & Responsive Gallery Layout */

:root {
    --primary: #ffc107;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --success: #10b981;
}

body {
    background-color: var(--bg-body);
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding-bottom: 40px;
}

/* --- Container (Max 800px for Desktop) --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Stats Widget --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* Very compact stats */
    gap: 8px;
    margin-bottom: 20px;
}

.stat-widget {
    background: var(--bg-card);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--primary); display: block; }
.stat-title { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* --- Search Toolbar --- */
.toolbar {
    background: var(--bg-card);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allows wrapping on tiny screens */
}

.search-wrapper { flex: 1; min-width: 150px; }

.modern-search {
    width: 100%;
    padding: 8px 12px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.modern-search:focus { border-color: var(--primary); }

.action-btn {
    padding: 8px 15px;
    background: #334155;
    color: #cbd5e1;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: not-allowed;
    white-space: nowrap;
}
.action-btn.active { background: var(--danger); color: white; cursor: pointer; }

/* --- FILE GRID (Responsive Logic) --- */
.file-grid {
    display: grid;
    /* Desktop: 3 cards per row */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 12px;
}

.file-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.2s;
    overflow: hidden; /* Prevents content spill */
}

.file-box:hover { border-color: var(--primary); transform: translateY(-2px); }

/* Checkbox */
.box-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    z-index: 5;
}

/* Icon / Image */
.box-icon {
    width: 50px;
    height: 50px;
    background: #0f172a;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 1.2rem;
    overflow: hidden;
}
.box-icon img { width: 100%; height: 100%; object-fit: cover; }

/* Text Info */
.box-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Important for long names */
    width: 100%;
    margin-bottom: 2px;
}

.box-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Buttons */
.box-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    background: #334155;
    color: #e2e8f0;
    transition: 0.2s;
}

.btn-view:hover { background: var(--success); color: #fff; }
.btn-copy:hover { background: #3b82f6; color: #fff; }
.btn-del:hover { background: var(--danger); color: #fff; }


/* --- MOBILE SPECIFIC FIXES (Max Width 600px) --- */
@media (max-width: 600px) {
    .container {
        padding: 10px; /* Less padding on mobile */
    }

    /* Force 2 Columns on Mobile for Gallery Look */
    .file-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px;
    }

    /* Smaller Cards on Mobile */
    .file-box {
        padding: 10px 5px; /* Very compact padding */
    }

    .box-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .box-name {
        font-size: 0.75rem; /* Smaller text */
    }

    .box-date {
        font-size: 0.6rem;
        margin-bottom: 8px;
    }

    .btn-icon {
        width: 26px; /* Smaller buttons */
        height: 26px;
        font-size: 0.7rem;
    }
    
    .box-actions {
        gap: 5px; /* Tighter button gap */
    }
}
