/* AL-HAL Debt Management System - Main Styles */
/* Glassmorphism Design with RTL Support */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
}

/* Glass Effect Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

.glass-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: 4px 0 24px rgba(31, 38, 135, 0.1);
}

.glass-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-input {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dark Theme Adjustments */
[data-theme="dark"] .glass-navbar {
    background: rgba(0, 0, 0, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .glass-header {
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .glass-input {
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

/* Button Styles */
.btn {
    @apply px-6 py-3 rounded-lg font-medium transition-all duration-300 transform hover:scale-105 active:scale-95;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.4);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.4);
}

.btn-sm {
    @apply px-4 py-2 text-sm;
}

.btn-lg {
    @apply px-8 py-4 text-lg;
}

/* Form Controls */
.form-group {
    @apply mb-6;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
    text-align: right;
}

[data-theme="dark"] .form-label {
    @apply text-gray-300;
}

.form-control {
    @apply w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-300;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: right;
}

[data-theme="dark"] .form-control {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    @apply form-control;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-left: 2.75rem;
}

/* Navigation Styles */
.navbar {
    @apply fixed right-0 top-0 h-full w-64 z-40 transform transition-transform duration-300;
}

.navbar-brand {
    @apply flex items-center px-6 py-8;
}

.navbar-brand img {
    @apply h-10 w-10 ml-3;
}

.navbar-brand h1 {
    @apply text-xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent;
}

.navbar-nav {
    @apply px-4 space-y-2;
}

.nav-item {
    @apply relative;
}

.nav-link {
    @apply flex items-center px-4 py-3 rounded-lg text-gray-700 hover:bg-white hover:bg-opacity-50 transition-all duration-300 group;
    text-decoration: none;
}

.nav-link:hover {
    transform: translateX(-4px);
}

.nav-link.active {
    @apply bg-white bg-opacity-70;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.nav-link i {
    @apply ml-3 text-lg;
    transition: all 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

[data-theme="dark"] .nav-link {
    @apply text-gray-300;
}

[data-theme="dark"] .nav-link:hover {
    @apply bg-white bg-opacity-10;
}

[data-theme="dark"] .nav-link.active {
    @apply bg-white bg-opacity-20;
}

/* Header Styles */
.header {
    @apply sticky top-0 z-30 px-6 py-4;
}

.header-content {
    @apply flex items-center justify-between;
}

.header-title {
    @apply text-2xl font-bold text-gray-800;
}

[data-theme="dark"] .header-title {
    @apply text-white;
}

.header-actions {
    @apply flex items-center space-x-4 space-x-reverse;
}

.search-box {
    @apply relative;
}

.search-input {
    @apply pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 w-64;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-align: right;
}

.search-icon {
    @apply absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400;
}

/* Card Styles */
.card {
    @apply glass-card p-6 hover:shadow-lg transition-all duration-300;
}

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

.card-header {
    @apply flex items-center justify-between mb-4 pb-4 border-b border-gray-200;
}

[data-theme="dark"] .card-header {
    @apply border-gray-600;
}

.card-title {
    @apply text-lg font-semibold text-gray-800;
}

[data-theme="dark"] .card-title {
    @apply text-white;
}

.card-subtitle {
    @apply text-sm text-gray-500;
}

[data-theme="dark"] .card-subtitle {
    @apply text-gray-400;
}

.card-body {
    @apply space-y-4;
}

.card-footer {
    @apply mt-6 pt-4 border-t border-gray-200 flex items-center justify-between;
}

[data-theme="dark"] .card-footer {
    @apply border-gray-600;
}

/* Table Styles */
.table {
    @apply w-full;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    @apply px-6 py-4 text-right text-sm font-medium text-gray-500 uppercase tracking-wider;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .table th {
    @apply text-gray-300;
    background: rgba(0, 0, 0, 0.3);
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
}

[data-theme="dark"] .table td {
    @apply text-gray-200;
    background: rgba(0, 0, 0, 0.2);
}

.table tbody tr {
    @apply border-b border-gray-200;
    transition: all 0.2s ease;
}

[data-theme="dark"] .table tbody tr {
    @apply border-gray-600;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

/* Status Badges */
.badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-xs font-medium;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.badge-success {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
    @apply text-blue-800 border border-blue-300;
}

.badge-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    @apply text-yellow-800 border border-yellow-300;
}

.badge-danger {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.2) 0%, rgba(254, 225, 64, 0.2) 100%);
    @apply text-red-800 border border-red-300;
}

.badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    @apply text-purple-800 border border-purple-300;
}

/* Dark theme badge adjustments */
[data-theme="dark"] .badge-success {
    @apply text-blue-300 border-blue-600;
}

[data-theme="dark"] .badge-warning {
    @apply text-yellow-300 border-yellow-600;
}

[data-theme="dark"] .badge-danger {
    @apply text-red-300 border-red-600;
}

[data-theme="dark"] .badge-info {
    @apply text-purple-300 border-purple-600;
}

/* Statistics Cards */
.stat-card {
    @apply glass-card p-6 text-center relative overflow-hidden;
}

.stat-card::before {
    content: '';
    @apply absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-blue-500 to-purple-500;
}

.stat-value {
    @apply text-3xl font-bold text-gray-800 mb-2;
}

[data-theme="dark"] .stat-value {
    @apply text-white;
}

.stat-label {
    @apply text-sm text-gray-500 uppercase tracking-wider;
}

[data-theme="dark"] .stat-label {
    @apply text-gray-400;
}

.stat-change {
    @apply text-xs mt-2;
}

.stat-change.positive {
    @apply text-green-600;
}

.stat-change.negative {
    @apply text-red-600;
}

/* Loading States */
.loading {
    @apply relative overflow-hidden;
}

.loading::after {
    content: '';
    @apply absolute inset-0 bg-gradient-to-r from-transparent via-white to-transparent opacity-30;
    animation: shimmer 2s infinite;
}

[data-theme="dark"] .loading::after {
    @apply via-gray-600;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        @apply transform translate-x-full;
    }
    
    .navbar.open {
        @apply transform translate-x-0;
    }
    
    main {
        @apply mr-0;
    }
    
    .search-input {
        @apply w-48;
    }
    
    .card {
        @apply p-4;
    }
    
    .table-responsive {
        @apply overflow-x-auto;
    }
}

/* Utility Classes */
.text-gradient {
    @apply bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent;
}

.shadow-glass {
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

.border-glass {
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Print Styles */
@media print {
    .navbar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    main {
        @apply mr-0;
    }
    
    .glass-card {
        @apply bg-white border border-gray-300;
        backdrop-filter: none;
        box-shadow: none;
    }
}