/**
 * Premium RTL Styles
 * Financial Association Management System
 * Dark Blue & Gold Theme
 */

/* ===== CSS Variables ===== */
:root {
    --primary-dark: #0a1628;
    --primary-blue: #1a365d;
    --primary-light: #2c5282;
    --accent-gold: #d4af37;
    --accent-gold-light: #f4e4bc;
    --accent-gold-dark: #b8960c;
    --text-light: #f7fafc;
    --text-muted: #a0aec0;
    --success: #48bb78;
    --danger: #f56565;
    --warning: #ed8936;
    --info: #4299e1;
    --bg-dark: #0d1b2a;
    --bg-card: #1b263b;
    --bg-card-hover: #253352;
    --border-color: #2d3748;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-gold-light);
}

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

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    color: var(--accent-gold);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    padding: 10px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        width: 100%;
    }
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--accent-gold);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
}

.nav-link.active {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: var(--primary-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--primary-blue);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
}

.btn-outline:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-gold);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    color: var(--accent-gold);
    margin: 0;
}

.card-body {
    padding: 1rem 0;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23d4af37' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 2.5rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--accent-gold);
}

.form-check-label {
    color: var(--text-muted);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.table th,
.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--primary-blue);
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.table tr:hover {
    background: var(--bg-card-hover);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary { background: var(--primary-light); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-gold { background: var(--accent-gold); color: var(--primary-dark); }

/* ===== Alerts ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border-right: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--primary-blue) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, transparent 100%);
    opacity: 0.1;
    border-radius: 0 0 0 100%;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 50%, var(--primary-light) 100%);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

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

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Features Section ===== */
.features {
    padding: 4rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-dark);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    color: var(--text-muted);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    padding: 2rem 1rem;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 0.5rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-menu-link:hover,
.sidebar-menu-link.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
}

.sidebar-menu-icon {
    width: 24px;
    height: 24px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
    display: flex;
    gap: 2rem;
}

@media (max-width: 992px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    
    .nav {
        gap: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Print Styles ===== */
@media print {
    .header,
    .sidebar,
    .btn {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
