/* Variables */
:root {
    --primary-color: #2E5C87;
    --secondary-color: #4C84B9;
    --accent-color: #F8A15F;
    --dark-color: #1A2533;
    --light-color: #F8F9FA;
    --success-color: #28A745;
    --error-color: #DC3545;
    --warning-color: #FFC107;
    --info-color: #17A2B8;
    --sidebar-width: 280px;
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-primary: 'Cairo', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    direction: rtl;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

p {
    margin-bottom: 1rem;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--box-shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-left: 0.75rem;
    font-size: 1.2rem;
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
}

/* Sidebar */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--dark-color) 0%, #2A3F5A 100%);
    padding: 2rem 1rem;
    position: fixed;
    width: var(--sidebar-width);
    transition: var(--transition);
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(-5px);
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(46, 92, 135, 0.2);
}

.sidebar .nav-link i {
    margin-left: 1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    background-color: #F4F7FA;
    transition: var(--transition);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: white;
}

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

.card-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-bottom: none;
}

.card-body {
    padding: 1.5rem;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    transition: var(--transition);
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.stat-card .icon {
    font-size: 2.5rem;
    opacity: 0.9;
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .count {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .title {
    font-size: 1rem;
    opacity: 0.9;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Forms */
.form-control, .form-select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 92, 135, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-left: 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 92, 135, 0.3);
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #2ECC71);
}

.btn-danger {
    background: linear-gradient(45deg, var(--error-color), #E74C3C);
}

.btn-warning {
    background: linear-gradient(45deg, var(--warning-color), #F39C12);
}

.btn-info {
    background: linear-gradient(45deg, var(--info-color), #3498DB);
}

/* Badges */
.badge {
    padding: 0.5em 1em;
    border-radius: 6px;
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #117a8b;
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgcGF0dGVyblRyYW5zZm9ybT0icm90YXRlKDEzNSkiPjxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgZmlsbD0idHJhbnNwYXJlbnQiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiLz48cmVjdCBmaWxsPSJ1cmwoI3BhdHRlcm4pIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIi8+PC9zdmc+');
    opacity: 0.4;
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--dark-color) 0%, #1A2533 100%);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
}

/* API Documentation Styles */
.api-docs {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.endpoint-method {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: white;
    margin-left: 0.75rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.method-post {
    background-color: #28a745;
}

.method-get {
    background-color: #0d6efd;
}

.endpoint-tab {
    border-left: 3px solid transparent;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.endpoint-tab.active {
    border-left-color: #0d6efd;
    background-color: #f8f9fa;
}

.endpoint-tab:hover {
    background-color: #f8f9fa;
}

.code-tabs .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.code-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 1rem;
}

.code-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background-color: transparent;
}

/* Pricing Cards */
.pricing-card {
    transition: transform 0.3s ease;
}

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

/* Social Links */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    margin: 0 0.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

/* Copy Button */
.copy-btn {
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background-color: var(--success-color);
    color: white;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-right: 220px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        padding: 1rem 0.5rem;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem;
        justify-content: center;
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .nav-link i {
        margin: 0;
    }
    
    .main-content {
        margin-right: 70px;
    }
    
    .sidebar:hover {
        width: var(--sidebar-width);
    }
    
    .sidebar:hover .nav-link {
        justify-content: flex-start;
        padding: 0.75rem 1.25rem;
    }
    
    .sidebar:hover .nav-link span {
        display: inline;
    }
    
    .sidebar:hover .nav-link i {
        margin-left: 1rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        margin-bottom: 2rem;
    }
    
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
    
    .feature-card {
        margin-bottom: 1.5rem;
    }
    
    .stat-card .icon {
        position: static;
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
    }
    
    .d-flex.justify-content-between > * {
        margin-bottom: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--error-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.shadow-sm { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: var(--box-shadow) !important; }
.shadow-lg { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-circle { border-radius: 50% !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Animation */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .footer, .btn, .actions {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}