/* =====================================================
   Campus Rental Platform - Custom CSS
   ===================================================== */

/* =====================================================
   1. GLOBAL STYLES & VARIABLES
   ===================================================== */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* =====================================================
   2. LAYOUT & NAVIGATION
   ===================================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: #6c757d !important;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-hover);
    border-radius: var(--border-radius);
}

/* =====================================================
   3. CARDS & COMPONENTS
   ===================================================== */
.card {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* =====================================================
   4. ITEM DISPLAY & GRID
   ===================================================== */
.item-image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.item-image-container img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.item-image-container:hover img {
    transform: scale(1.05);
}

.item-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 2rem;
    border: 2px dashed #dee2e6;
    transition: var(--transition);
    height: 200px;
}

.item-image-placeholder:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
}

.item-image-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

/* =====================================================
   5. PRICE & STATUS BADGES
   ===================================================== */
.price-badge {
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary-color) !important;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.status-available {
    background-color: var(--success-color) !important;
}

.status-rented {
    background-color: var(--warning-color) !important;
    color: #000 !important;
}

.status-maintenance {
    background-color: var(--info-color) !important;
}

.status-unavailable {
    background-color: var(--secondary-color) !important;
}

/* =====================================================
   6. FORMS & INPUTS
   ===================================================== */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-form {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
}

.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: var(--transition);
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

/* =====================================================
   7. BUTTONS & INTERACTIONS
   ===================================================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    flex: 1;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* =====================================================
   8. STATISTICS & DASHBOARD
   ===================================================== */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.stats-card.success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #000;
}

.stats-card.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =====================================================
   9. USER PROFILE & AVATARS
   ===================================================== */
.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.user-info {
    text-align: center;
    padding: 1rem;
}

.user-type-badge {
    background: var(--light-color);
    color: var(--dark-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* =====================================================
   10. IMAGE GALLERY & PREVIEWS
   ===================================================== */
.image-upload-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    object-fit: cover;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.image-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
}

/* =====================================================
   11. ALERTS & NOTIFICATIONS
   ===================================================== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background-color: #d4edda;
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: #f8d7da;
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: #fff3cd;
}

.alert-info {
    border-left-color: var(--info-color);
    background-color: #d1ecf1;
}

/* =====================================================
   12. EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 1rem;
    color: #6c757d;
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   13. LOADING & ANIMATIONS
   ===================================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   14. RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: var(--border-radius) !important;
        margin-bottom: 0.25rem;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    .search-form {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-number {
        font-size: 1.75rem;
    }
    
    .item-image-container {
        height: 150px;
    }
    
    .item-image-container img,
    .item-image-placeholder {
        height: 150px;
    }
}

/* =====================================================
   15. PRINT STYLES
   ===================================================== */
@media print {
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* =====================================================
   16. ACCESSIBILITY IMPROVEMENTS
   ===================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* =====================================================
   17. UTILITY CLASSES
   ===================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.shadow {
    box-shadow: var(--box-shadow-hover) !important;
}

.rounded {
    border-radius: var(--border-radius) !important;
}

.border-start {
    border-left: 4px solid var(--primary-color) !important;
}

/* =====================================================
   18. DARK MODE SUPPORT (Optional)
   ===================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #1a1a1a;
        color: #f8f9fa;
    }
    
    .card {
        background-color: #2d3338;
        color: #f8f9fa;
    }
    
    .navbar {
        background-color: #2d3338 !important;
    }
}
