/**
 * Main stylesheet for Project Clean Management System
 */

/* General styles */
body {
    font-family: 'Tajawal', sans-serif;
    background-color: #f8f9fa;
}

/* Card styles */
.card {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: bold;
}

/* Dashboard stats */
.stats-card {
    transition: transform 0.3s;
    border-radius: 10px;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stats-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stats-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.stats-card .card-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Custom background colors */
.bg-purple {
    background-color: #6f42c1 !important;
    color: #fff !important;
}

.bg-teal {
    background-color: #20c997 !important;
    color: #fff !important;
}

.bg-orange {
    background-color: #fd7e14 !important;
    color: #fff !important;
}

/* Project status badges */
.badge-pending {
    background-color: #ffc107;
    color: #212529;
}

.badge-in-progress {
    background-color: #17a2b8;
    color: #fff;
}

.badge-completed {
    background-color: #28a745;
    color: #fff;
}

.badge-approved {
    background-color: #6f42c1;
    color: #fff;
}

/* Image gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* Form styles */
.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Table styles */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Custom file input */
.custom-file-input::-webkit-file-upload-button {
    visibility: hidden;
}

.custom-file-input::before {
    content: 'اختر الملفات';
    display: inline-block;
    background: linear-gradient(to bottom, #f9f9f9, #e3e3e3);
    border: 1px solid #999;
    border-radius: 3px;
    padding: 5px 8px;
    outline: none;
    white-space: nowrap;
    cursor: pointer;
    text-shadow: 1px 1px #fff;
    font-weight: 700;
    font-size: 10pt;
}

.custom-file-input:hover::before {
    border-color: black;
}

.custom-file-input:active::before {
    background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        font-size: 12pt;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }
}

/* RTL specific adjustments */
.dropdown-menu-end {
    right: auto;
    left: 0;
}

/* Mobile bottom navigation */
.navbar.fixed-bottom {
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.fixed-bottom .nav-link {
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    text-align: center;
}

.navbar.fixed-bottom .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar.fixed-bottom .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
}

/* Add padding to bottom of page on mobile to account for fixed navbar */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 4.5rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Improve table display on mobile */
    .table-responsive {
        font-size: 0.9rem;
    }

    /* Adjust card padding */
    .card-body {
        padding: 1rem;
    }

    /* Make buttons more touch-friendly */
    .btn {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.25rem;
    }

    /* Adjust form elements */
    .form-control, .form-select {
        font-size: 1rem;
        height: calc(2.5rem + 2px);
    }

    /* Improve navbar on tablets */
    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
    }

    /* Adjust stats cards */
    .stats-card .card-text {
        font-size: 1.5rem;
    }

    .stats-icon {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .image-gallery {
        grid-template-columns: 1fr;
    }

    /* Further adjustments for phones */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Make buttons stack on mobile */
    .btn-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
    }

    /* Adjust headings */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Improve table display on phones */
    .table-responsive {
        font-size: 0.8rem;
    }

    /* Adjust modal size */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* Improve form layout */
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }

    /* Adjust navbar on phones */
    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Make dropdown menu more touch-friendly */
    .dropdown-item {
        padding: 0.5rem 1rem;
    }
}

/* Import Google Fonts - Tajawal (Arabic) */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');
