/**
 * نظام تأجير بدلات العرائس
 * الأنماط المخصصة
 */

/* ==================== المتغيرات ==================== */
:root {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --light-bg: #f8f9fa;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ==================== الأساسيات ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==================== الشريط العلوي ==================== */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand i {
    margin-left: 0.5rem;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

/* ==================== البطاقات ==================== */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* بطاقات الإحصائيات */
.stat-card {
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.stat-card .stat-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.stat-card.bg-gradient-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.stat-card.bg-gradient-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card.bg-gradient-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-card.bg-gradient-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* ==================== الجداول ==================== */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-top: none;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.05);
}

/* ==================== الأزرار ==================== */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

/* ==================== النماذج ==================== */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 0.625rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-group-text {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* ==================== الشارات ==================== */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    border-radius: 0.375rem;
}

/* شارات حالة البدلة */
.badge-available { background-color: var(--success-color); }
.badge-reserved { background-color: var(--warning-color); }
.badge-rented { background-color: var(--info-color); }
.badge-cleaning { background-color: #6b7280; }
.badge-repair { background-color: var(--danger-color); }
.badge-blocked { background-color: #1f2937; }

/* ==================== صور البدلات ==================== */
.dress-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
}

.dress-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.dress-gallery-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 3/4;
}

.dress-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dress-gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 1rem 0.5rem 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dress-gallery-item:hover .overlay {
    opacity: 1;
}

/* ==================== صفحة تسجيل الدخول ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: 1rem 1rem 0 0;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-body {
    padding: 2rem;
}

/* ==================== الـ Modal ==================== */
.modal-content {
    border: none;
    border-radius: 1rem;
}

.modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f3f4f6;
    padding: 1rem 1.5rem;
}

/* ==================== التنبيهات ==================== */
.alert {
    border: none;
    border-radius: 0.75rem;
}

/* ==================== صفحة التقارير ==================== */
.report-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.report-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ==================== التقويم ==================== */
.calendar-day {
    min-height: 100px;
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
}

.calendar-day.today {
    background-color: rgba(139, 92, 246, 0.1);
}

.calendar-event {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group-responsive .btn {
        width: 100%;
    }
    
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    main {
        padding: 1rem !important;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* ==================== الطباعة ==================== */
@media print {
    .navbar, .btn, .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
    }
}

/* ==================== تحسينات إضافية ==================== */
.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: var(--card-shadow-hover);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-primary-subtle {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.bg-primary-subtle {
    background-color: rgba(139, 92, 246, 0.1) !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
}

/* Status Indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.5rem;
}

.status-dot.online { background-color: var(--success-color); }
.status-dot.offline { background-color: #6b7280; }
.status-dot.warning { background-color: var(--warning-color); }
