/* ===== RESET & GLOBAL STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    color: #ffffff !important;
    background-color: #111 !important;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6,
p, span, div, label, li,
td, th, small, strong, em {
    color: #ffffff !important;
}

/* ===== FORMS - فرم‌های آبشاری ===== */
.form-control,
.form-select,
.form-check-input,
.form-range {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

/* استایل خاص برای فرم‌های آبشاری */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='white' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.5rem !important;
}

/* حالت hover و focus برای فرم‌های آبشاری */
.form-select:hover {
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.form-select:focus {
    background-color: rgba(0, 0, 0, 0.9) !important;
    border-color: #007bff !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25) !important;
}

/* گزینه‌های داخل فرم آبشاری */
.form-select option {
    background-color: #222 !important;
    color: #ffffff !important;
    padding: 10px !important;
}

.form-select option:hover,
.form-select option:focus,
.form-select option:checked {
    background-color: #007bff !important;
    color: #ffffff !important;
}

/* برای حالت multiple select */
.form-select[multiple] {
    background-image: none !important;
    padding: 0.375rem 0.75rem !important;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(0, 0, 0, 0.9) !important;
    border-color: #007bff !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25) !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-label {
    color: #ffd700 !important;
    font-weight: bold !important;
    margin-bottom: 0.5rem !important;
}

.form-text {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.875rem !important;
}

/* ===== CARDS ===== */
.card {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    font-weight: bold !important;
    padding: 1rem 1.25rem !important;
    border-radius: 10px 10px 0 0 !important;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    padding: 1rem 1.25rem !important;
    border-radius: 0 0 10px 10px !important;
}

/* ===== TABLES ===== */
.table {
    color: #ffffff !important;
    background-color: transparent !important;
}

.table th {
    background-color: rgba(0, 123, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffd700 !important;
    font-weight: bold !important;
    padding: 1rem !important;
    vertical-align: middle !important;
}

.table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 1rem !important;
    vertical-align: middle !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* ===== ALERTS ===== */
.alert {
    color: #ffffff !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    padding: 1rem 1.25rem !important;
    margin-bottom: 1rem !important;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.2) !important;
    border-color: rgba(40, 167, 69, 0.3) !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.2) !important;
    border-color: rgba(23, 162, 184, 0.3) !important;
}

.alert-primary {
    background-color: rgba(0, 123, 255, 0.2) !important;
    border-color: rgba(0, 123, 255, 0.3) !important;
}

/* ===== MODALS ===== */
.modal-content {
    background-color: #222 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 10px !important;
}

.modal-header {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 10px 10px 0 0 !important;
}

.modal-body {
    color: #ffffff !important;
    padding: 1.5rem !important;
}

.modal-footer {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 0 0 10px 10px !important;
}

.modal-title {
    color: #ffffff !important;
    font-weight: bold !important;
}

/* ===== NAVIGATION & MENUS ===== */
.navbar {
    background-color: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 2px solid #007bff !important;
    padding: 0.75rem 1rem !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

.navbar-brand {
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 1.5rem !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem !important;
    border-radius: 5px !important;
    transition: all 0.3s ease !important;
}

.nav-link:hover,
.nav-link:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.nav-link.active {
    color: #ffffff !important;
    background-color: rgba(0, 123, 255, 0.3) !important;
    font-weight: bold !important;
}

/* منوی کاربر در user_dashboard.php */
.user-nav {
    background: rgba(0, 0, 0, 0.9) !important;
    border-bottom: 2px solid #007bff !important;
}

/* ===== BADGES ===== */
.badge {
    color: #ffffff !important;
    font-weight: normal !important;
    padding: 0.35em 0.65em !important;
}

.badge.bg-light,
.badge.bg-white {
    color: #000000 !important;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 6px !important;
    padding: 0.5rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3) !important;
    border: none !important;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34) !important;
    border: none !important;
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800) !important;
    border: none !important;
    color: #000 !important;
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #c82333) !important;
    border: none !important;
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496) !important;
    border: none !important;
}

/* ===== LOGO STYLES ===== */
.logo-img {
    height: 80px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    filter: brightness(1.2);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===== UTILITIES ===== */
.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }
.text-success { color: #28a745 !important; }
.text-primary { color: #007bff !important; }
.text-info { color: #17a2b8 !important; }

.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.text-white {
    color: #ffffff !important;
}

.bg-light,
.bg-white {
    color: #000000 !important;
}

/* ===== CUSTOM COMPONENTS ===== */
.address-cell {
    color: #ffffff !important;
    line-height: 1.6 !important;
}

.actions-cell {
    color: #ffffff !important;
}

/* ===== TABS ===== */
.nav-pills .nav-link {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 5px !important;
    border-radius: 8px !important;
}

.nav-pills .nav-link.active {
    background-color: rgba(0, 123, 255, 0.3) !important;
    color: #ffffff !important;
    font-weight: bold !important;
}

/* ===== BACKGROUND OVERRIDES ===== */
/* پس‌زمینه user_dashboard.php */
body.user-dashboard {
    background: url("../uploads/backgrounds/default-bg.jpg") center/cover fixed !important;
}

/* استایل برای تب‌ها */
.tab-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* استایل برای فرم‌های آبشاری */
.form-select option {
    background-color: #222 !important;
    color: #ffffff !important;
    padding: 12px !important;
}

.form-select option:checked,
.form-select option:hover {
    background-color: #007bff !important;
    color: #ffffff !important;
}

/* استایل برای تصاویر */
.property-image {
    cursor: pointer;
    transition: all 0.3s;
}

.property-image:hover {
    transform: scale(1.8);
    z-index: 1000;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}


/* ===== TABLES IMPROVEMENT ===== */
.table-responsive {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.table th {
    background: linear-gradient(to bottom, rgba(0, 123, 255, 0.3), rgba(0, 86, 179, 0.3)) !important;
    color: #ffd700 !important;
    font-weight: bold !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    white-space: nowrap !important;
    padding: 12px 8px !important;
}

.table td {
    background: rgba(0, 0, 0, 0.7) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    padding: 10px 8px !important;
    text-align: center !important;
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* برای سلول‌هایی که نیاز به متن طولانی دارند */
.table td.text-wrap {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 300px !important;
}

/* آدرس در جدول */
.address-box {
    background: rgba(255, 255, 255, 0.05) !important;
    border-right: 3px solid #007bff !important;
    padding: 8px 12px !important;
    border-radius: 5px !important;
    text-align: right !important;
    direction: rtl !important;
    line-height: 1.6 !important;
    max-height: 100px !important;
    overflow-y: auto !important;
    margin: 0 !important;
}

/* اسکرول افقی برای جدول‌های عریض */
.table-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* بدنه جدول */
.data-table {
    margin-bottom: 0 !important;
}

/* سطرهای زوج و فرد */
.table-striped tbody tr:nth-of-type(odd) td {
    background: rgba(0, 0, 0, 0.65) !important;
}

.table-striped tbody tr:nth-of-type(even) td {
    background: rgba(0, 0, 0, 0.75) !important;
}

/* مودال عکس‌ها */
.modal-content {
    background: #222 !important;
}

.modal-body img {
    max-height: 70vh;
    width: auto;
    margin: 0 auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* استایل‌های فوتر حرفه‌ای */
.footer {
    background: linear-gradient(90deg, rgba(33,37,41,0.95) 0%, rgba(20,20,20,0.95) 100%) !important;
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 193, 7, 0.3) !important;
    margin-top: 50px;
}

.developer-link {
    position: relative;
    padding: 3px 10px;
    border-radius: 5px;
    background: rgba(255, 193, 7, 0.1);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.developer-link:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.2);
}

.highlight-text {
    background: linear-gradient(90deg, #ffc107, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* انیمیشن برای لوگو */
.footer img {
    transition: all 0.3s ease;
    filter: brightness(0.9);
}

.footer img:hover {
    transform: rotate(5deg) scale(1.1);
    filter: brightness(1.2);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .footer {
        text-align: center !important;
        padding: 20px 0 !important;
    }
    
    .footer .row {
        flex-direction: column;
    }
    
    .footer .col-md-6 {
        margin-bottom: 15px;
        text-align: center !important;
    }
    
    .developer-link {
        display: inline-block;
        margin-top: 5px;
    }
}

/* استایل برای خریداران بایگانی شده */
.archived-row {
    opacity: 0.7;
    background: rgba(255, 0, 0, 0.1) !important;
}

.archived-badge {
    background: #6c757d !important;
}

/* استایل‌های دکمه‌های عملیات */
.btn-group .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 1px;
}

/* استایل برای ردیف‌های بایگانی شده */
.archived-row {
    opacity: 0.8;
    background-color: rgba(108, 117, 125, 0.1) !important;
}

.archived-row:hover {
    background-color: rgba(108, 117, 125, 0.2) !important;
}

/* افکت‌ها برای دکمه‌ها */
.btn-group .btn {
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* استایل برای دکمه حذف */
.btn-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}

/* استایل برای دکمه فعال‌سازی */
.btn-success:hover {
    background-color: #198754;
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.5);
}

/* استایل برای دکمه بایگانی */
.btn-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.5);
}

/* استایل برای دکمه مشاهده */
.btn-info:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    box-shadow: 0 0 0 0.2rem rgba(13, 202, 240, 0.5);
}