:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --bs-border-radius-xl: 1rem;
    --text-dark: #0f172a;
}

/* Layout */
.breadcrumb-area {
    margin: 20px 0;
}

.breadcrumb-area h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
}

.page-container {
    min-height: 100vh;
    background: #f8f9fa;
    padding: 2rem 0;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--bs-border-radius-xl);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075);
    transition: transform .2s ease;
}

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

.upload-area {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 2rem;
    border-radius: var(--bs-border-radius-xl);
}

.table-container {
    background: #fff;
    border-radius: var(--bs-border-radius-xl);
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 10px;
    padding: .75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .15);
}

/* Strict File Input Fix */
.page-container input[type="file"],
.form-control[type="file"] {
    display: block !important;
    width: 100% !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #212529 !important;
    background-color: #fff !important;
    background-clip: padding-box !important;
    border: 1px solid #ced4da !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 0.375rem !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
    height: auto !important;
    min-height: 38px !important;
    /* Standard Bootstrap height */
    margin: 0 !important;
}

/* Fix for Input Groups */
.input-group>input[type="file"].form-control,
.input-group>.page-container .input-group input[type="file"],
.input-group>input[type="file"] {
    .input-group>.form-control[type="file"] {
        width: 1% !important;
        flex: 1 1 auto !important;
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .page-container input[type="file"]::file-selector-button,
    .form-control[type="file"]::file-selector-button {
        padding: 0.375rem 0.75rem !important;
        margin: -0.375rem -0.75rem !important;
        margin-inline-end: 0.75rem !important;
        color: #212529 !important;
        background-color: #e9ecef !important;
        pointer-events: none !important;
        border-color: inherit !important;
        border-style: solid !important;
        border-width: 0 !important;
        border-inline-end-width: 1px !important;
        border-radius: 0 !important;
        transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
        cursor: pointer !important;
        height: 100% !important;
    }

    /* Webkit fallback for older browsers just in case */
    .page-container input[type="file"]::-webkit-file-upload-button,
    .form-control[type="file"]::-webkit-file-upload-button {
        padding: 0.375rem 0.75rem !important;
        margin: -0.375rem -0.75rem !important;
        margin-inline-end: 0.75rem !important;
        color: #212529 !important;
        background-color: #e9ecef !important;
        pointer-events: none !important;
        border-color: inherit !important;
        border-style: solid !important;
        border-width: 0 !important;
        border-inline-end-width: 1px !important;
        border-radius: 0 !important;
        height: 100% !important;
    }

    .page-container input[type="file"]:hover:not(:disabled):not([readonly])::file-selector-button,
    .form-control[type="file"]:hover:not(:disabled):not([readonly])::file-selector-button {
        background-color: #dde0e3 !important;
    }

    /* Toasts */
    .toast-container {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1050;
    }

    /* Tables */
    .table thead th {
        background: #f1f5f9;
        color: var(--text-dark);
        font-weight: 600;
        border-bottom: none;
    }

    .table tbody tr {
        background: #fff;
    }

    .table tbody tr:hover {
        background: #f8fafc;
    }

    .table td,
    .table th {
        vertical-align: middle;
    }

    .truncate {
        max-width: 720px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Buttons */
    .btn-custom {
        padding: .5rem 1.5rem;
        border-radius: 50px;
        transition: all .3s ease;
    }

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

    @media (max-width:768px) {
        .btn {
            width: 100%;
        }
    }

    /* Gallery Styles (gallery-photo.php) */
    :root {
        --gallery-primary: #e15b2c;
        --transition-speed: .3s;
    }

    .gallery-container {
        flex: 1;
        padding: 20px;
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }

    .filter-button {
        font-weight: 600;
        font-size: 16px;
        background-color: var(--gallery-primary);
        color: #fff;
        border-radius: 5px;
        padding: 10px 15px;
        margin: 0 5px 15px;
        border: none;
        cursor: pointer;
        transition: all .3s ease;
    }

    .filter-button:hover,
    .filter-button.active {
        background-color: #c04a20;
        transform: translateY(-2px);
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        /* Padding removed to align with page edges */
    }

    .gallery-grid p {
        grid-column: 1 / -1;
    }

    .gallery-item {
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
        transition: all var(--transition-speed) ease;
        aspect-ratio: 4/3;
        opacity: 1;
        transform: scale(1);
        animation: fadeIn .5s ease forwards;
    }

    .gallery-item.hidden {
        opacity: 0;
        transform: scale(.8);
        position: absolute;
        width: 0;
        height: 0;
        padding: 0;
        margin: 0;
        border: 0;
        visibility: hidden;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s ease;
    }

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

    .category-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(225, 91, 44, 0.9);
        color: #fff;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 12px;
        font-weight: 600;
        opacity: 0;
        transition: opacity .3s ease;
    }

    .gallery-item:hover .category-badge {
        opacity: 1;
    }

    @media (max-width:767px) {
        .filter-button {
            font-size: 14px;
            padding: 8px 12px;
            margin: 0 3px 10px;
        }

        .gallery-grid {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Staggered animation delays */
    .gallery-grid .gallery-item:nth-child(1) {
        animation-delay: .05s;
    }

    .gallery-grid .gallery-item:nth-child(2) {
        animation-delay: .10s;
    }

    .gallery-grid .gallery-item:nth-child(3) {
        animation-delay: .15s;
    }

    .gallery-grid .gallery-item:nth-child(4) {
        animation-delay: .20s;
    }

    .gallery-grid .gallery-item:nth-child(5) {
        animation-delay: .25s;
    }

    .gallery-grid .gallery-item:nth-child(6) {
        animation-delay: .30s;
    }

    .gallery-grid .gallery-item:nth-child(7) {
        animation-delay: .35s;
    }

    .gallery-grid .gallery-item:nth-child(8) {
        animation-delay: .40s;
    }

    .gallery-grid .gallery-item:nth-child(9) {
        animation-delay: .45s;
    }

    .gallery-grid .gallery-item:nth-child(10) {
        animation-delay: .50s;
    }

    .gallery-grid .gallery-item:nth-child(11) {
        animation-delay: .55s;
    }

    .gallery-grid .gallery-item:nth-child(12) {
        animation-delay: .60s;
    }

    .gallery-grid .gallery-item:nth-child(13) {
        animation-delay: .65s;
    }

    .gallery-grid .gallery-item:nth-child(14) {
        animation-delay: .70s;
    }

    .gallery-grid .gallery-item:nth-child(15) {
        animation-delay: .75s;
    }

    .gallery-grid .gallery-item:nth-child(16) {
        animation-delay: .80s;
    }

    .gallery-grid .gallery-item:nth-child(17) {
        animation-delay: .85s;
    }

    .gallery-grid .gallery-item:nth-child(18) {
        animation-delay: .90s;
    }

    .gallery-grid .gallery-item:nth-child(19) {
        animation-delay: .95s;
    }

    .gallery-grid .gallery-item:nth-child(20) {
        animation-delay: 1.00s;
    }