/**
 * JADA Admin Panel - Centralized Styles
 * Main stylesheet for the JadaAdmin web application
 */

/* ============================================
   1. LAYOUT COMPONENTS
   ============================================ */

/* Sidebar Navigation */
.sidebar {
    background: linear-gradient(135deg, blue 0%, black 100%);
    min-height: 100vh;
    color: white;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.main-content {
    background-color: #f8f9fa;
}

/* Top Navigation Bar */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   2. CARD COMPONENTS
   ============================================ */

/* Standard Card */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-2px);
}

/* Stats Card with Gradient */
.stats-card {
    background: linear-gradient(135deg, blue 0%, black 100%);
    color: white;
    height: 100%;
}

.stats-card .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* ============================================
   3. USER AVATARS
   ============================================ */

/* Standard User Avatar (40px) */
.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, blue 0%, black 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Table User Avatar (35px) */
.table-user-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, blue 0%, black 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* ============================================
   4. ALERTS & BADGES
   ============================================ */

/* Alert Styling */
.alert {
    border-radius: 10px;
}

/* Status Badge */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Priority Badge */
.priority-badge {
    font-size: 0.8rem;
}

/* Custom Role Badges */
.badge-super-admin {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.badge-admin {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

/* ============================================
   5. BUTTONS
   ============================================ */

/* Small Buttons */
.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Gradient Button */
.btn-gradient {
    background: linear-gradient(135deg, blue 0%, black 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, blue 0%, black 100%);
    color: white;
}

/* Login Button */
.btn-login {
    background: linear-gradient(135deg, blue 0%, black 100%);
    border: none;
    padding: 12px;
    font-weight: 500;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   6. FORM ELEMENTS
   ============================================ */

/* Form Floating Margin */
.form-floating {
    margin-bottom: 1rem;
}

/* Form Section */
.form-section {
    border-left: 4px solid blue;
    padding-left: 1rem;
    margin-bottom: 2rem;
}

/* Form Check Input (Checked State) */
.form-check-input:checked {
    background-color: blue;
    border-color: blue;
}

/* ============================================
   7. TABLE COMPONENTS
   ============================================ */

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.3;
}

.sortable.asc::after {
    content: '▲';
    opacity: 0.8;
}

.sortable.desc::after {
    content: '▼';
    opacity: 0.8;
}

/* Announcement Content Truncation */
.announcement-content {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   8. PAGE-SPECIFIC STYLES
   ============================================ */

/* ========== Login Page ========== */
.login-page {
    background: linear-gradient(135deg, blue 0%, black 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

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

.login-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    margin: 0;
}

/* ========== Dashboard Stats Cards ========== */
.stats-card.dashboard-variant {
    background: linear-gradient(135deg, blue 0%, black 100%);
    color: white;
}

/* ========== Admin Users Stats Cards ========== */
.stats-card.admin-users-variant {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

/* Avatar Placeholder */
.avatar-placeholder {
    width: 40px;
    height: 40px;
}

/* ========== Announcement Forms ========== */
.form-label {
    font-weight: 600;
}

.content-preview {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f8f9fa;
    min-height: 200px;
}

#locationTargeting {
    display: none;
}

.priority-slider {
    width: 100%;
}

/* ========== Form Focus States ========== */
.form-control:focus {
    border-color: blue;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========== Image Management ========== */
.image-card {
    transition: transform 0.2s;
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.image-card:hover {
    transform: translateY(-2px);
}

.image-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    cursor: pointer;
}

.image-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-thumbnail:hover {
    transform: scale(1.05);
}

/* Alternative smaller thumbnail size */
.image-thumbnail.small {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

/* Status badge for image cards - positioned absolutely over images */
.image-card .status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.status-approved {
    background-color: #198754;
}

.status-rejected {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
    color: #000;
}

.image-modal .modal-body {
    text-align: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.0rem;
    margin-bottom: 2rem;
}

@media (min-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
}

.user-info {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.filter-controls {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   9. UTILITY CLASSES
   ============================================ */

/* Horizontal Rule Styling */
hr.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.2);
}
