/* إعادة تعيين الأنماط الافتراضية */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Arial', sans-serif;
}

/* تنسيق الجسم العام */
body {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #fff;
    text-align: center;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-weight: 300;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><circle cx="20" cy="20" r="20" fill="rgba(255,255,255,0.03)"/><circle cx="80" cy="80" r="30" fill="rgba(255,255,255,0.04)"/></svg>');
    background-size: 100px 100px;
    opacity: 0.5;
    z-index: -1;
}

/* حاوية المحتوى */
.container {
    background: rgba(255, 255, 255, 0.15);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 1000px;
    text-align: center;
    margin-top: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 255, 255, 0.15);
}

.container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transform: rotate(30deg);
    transition: opacity 0.5s;
    pointer-events: none;
}

.container:hover::after {
    opacity: 1;
}

/* العنوان الرئيسي */
h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.3);
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #fdbb2d, #b21f1f, #1a2a6c);
    border-radius: 3px;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -100px; }
    100% { background-position: 100px; }
}

h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #f1f1f1;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* العنوان الفرعي */
p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #e1e1e1;
    line-height: 1.6;
}

/* الرسائل مثل النجاح أو الفشل */
p.success, p.error {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 500;
    animation: fadeIn 0.5s ease, pulse 2s infinite;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0% { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); }
    100% { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
}

p.success {
    background-color: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.5);
    color: #2ecc71;
}

p.error {
    background-color: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* تنسيق النماذج */
form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

/* الحقول المدخلة */
input, select, button, textarea {
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

input:focus, select:focus, textarea:focus {
    border-color: #fdbb2d;
    outline: none;
    background-color: #fff;
    box-shadow: 0 5px 20px rgba(253, 187, 45, 0.3);
    transform: translateY(-2px);
}

input::placeholder, textarea::placeholder {
    color: #999;
    opacity: 0.8;
    transition: all 0.3s ease;
}

input:focus::placeholder, textarea:focus::placeholder {
    opacity: 0.5;
    transform: translateY(-5px);
}

/* تنسيق زر التنفيذ */
button {
    background: linear-gradient(45deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 200% 200%;
    color: white;
    border: none;
    cursor: pointer;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.5s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: gradientButton 5s ease infinite;
}

@keyframes gradientButton {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    animation-play-state: paused;
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

button:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #1a2a6c, #b21f1f);
    background-size: 200% 200%;
}

.btn-secondary {
    background: linear-gradient(45deg, #1a2a6c, #4a69bd);
    background-size: 200% 200%;
    box-shadow: 0 10px 20px rgba(26, 42, 108, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #4a69bd, #1a2a6c);
    background-size: 200% 200%;
    box-shadow: 0 15px 25px rgba(26, 42, 108, 0.4);
}

/* تنسيق النص الخاص بالبيان */
textarea {
    resize: none;
    height: 160px;
    font-size: 16px;
    line-height: 1.5;
    background-color: rgba(255, 255, 255, 0.9);
}

/* تنسيق الجدول في حالة عرض العمليات */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 10px rgba(255, 255, 255, 0.1);
    transform: perspective(1000px) rotateX(0deg);
    transition: all 0.5s ease;
    background-color: rgba(255, 255, 255, 0.05);
}

table:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.15);
    transform: perspective(1000px) rotateX(2deg);
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    background: linear-gradient(45deg, #1a2a6c, #4a69bd);
    color: white;
    font-weight: 600;
    padding: 18px;
    text-align: center;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

td {
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 16px;
    text-align: center;
    font-size: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

tr:hover td {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

/* تحسين استجابة الجداول للأجهزة المختلفة */
@media (max-width: 992px) {
    table {
        margin-top: 20px;
        border-radius: 12px;
    }
    
    th, td {
        padding: 14px 12px;
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    /* تغيير عرض الجدول للشاشات المتوسطة */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 10px;
        transform: none !important;
    }
    
    table:hover {
        transform: none !important;
    }
    
    th, td {
        padding: 12px 10px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    /* تحويل الجدول إلى عرض بطاقات للشاشات الصغيرة */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    table {
        border-radius: 10px;
        overflow: hidden;
        white-space: normal;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 15px;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        position: relative;
    }
    
    tr:last-child {
        margin-bottom: 0;
    }
    
    td {
        position: relative;
        padding: 12px 10px 12px 50%;
        text-align: right;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        min-height: 45px;
    }
    
    td:before {
        position: absolute;
        top: 12px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
        color: #1a2a6c;
    }
    
    tr:hover td {
        transform: none;
    }
    
    .deposit-row td, .withdraw-row td {
        border-left: none;
    }
    
    .deposit-row {
        border-right: 4px solid rgba(46, 204, 113, 0.7);
    }
    
    .withdraw-row {
        border-right: 4px solid rgba(231, 76, 60, 0.7);
    }
}

/* تنسيق صفوف الإيداع والسحب */
.deposit-row td {
    border-left: 4px solid rgba(46, 204, 113, 0.7);
}

.withdraw-row td {
    border-left: 4px solid rgba(231, 76, 60, 0.7);
}

/* تنسيق نوع المعاملة */
.transaction-type {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.transaction-type:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.transaction-type.deposit {
    background: linear-gradient(45deg, rgba(46, 204, 113, 0.2), rgba(39, 174, 96, 0.2));
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.5);
}

.transaction-type.withdraw {
    background: linear-gradient(45deg, rgba(231, 76, 60, 0.2), rgba(192, 57, 43, 0.2));
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

/* تنسيق الرصيد */
.positive-balance {
    color: #2ecc71;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(46, 204, 113, 0.3);
}

.negative-balance {
    color: #e74c3c;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

/* الرابط للعمليات */
a {
    color: #fdbb2d;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

a:hover {
    color: #fff;
    transform: translateY(-2px);
}

a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #fdbb2d;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.action-link {
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0 3px;
    font-size: 14px;
    background-color: rgba(26, 42, 108, 0.1);
    color: #fdbb2d;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-link:hover {
    background-color: rgba(26, 42, 108, 0.2);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-link::after {
    display: none;
}

.action-link.delete {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.action-link.delete:hover {
    background-color: rgba(231, 76, 60, 0.2);
    color: #fff;
}

/* تنسيق الرابط لتسجيل الخروج */
.logout-link {
    color: #fff;
    background: linear-gradient(45deg, #1a2a6c, #4a69bd);
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 16px;
    margin-top: 30px;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(26, 42, 108, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.logout-link::after {
    display: none;
}

.logout-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.logout-link:hover {
    background: linear-gradient(45deg, #4a69bd, #1a2a6c);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(26, 42, 108, 0.4);
    color: #fff;
}

.logout-link:hover::before {
    left: 100%;
}

/* تنسيق قسم التصفية */
.filter-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 15px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.filter-section::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%);
    opacity: 0;
    transform: rotate(30deg);
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 0;
}

.filter-section:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.filter-section:hover::before {
    opacity: 1;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.filter-link {
    padding: 12px 25px;
    border-radius: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.filter-link::after {
    display: none;
}

.filter-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.filter-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.filter-link:hover::before {
    left: 100%;
}

.filter-link.active {
    background: linear-gradient(45deg, #fdbb2d, #b21f1f);
    color: #fff;
    box-shadow: 0 10px 25px rgba(178, 31, 31, 0.4);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.filter-link.active:hover {
    transform: translateY(-5px) scale(1.03);
}

/* تنسيق قسم تصفية التاريخ */
.date-filter {
    position: relative;
    z-index: 1;
    margin-top: 10px;
}

.date-filter-form {
    position: relative;
    display: inline-block;
}

.date-filter select {
    width: auto;
    min-width: 220px;
    margin-bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 12px 45px 12px 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.date-filter select:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.date-filter select:focus {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-color: #fdbb2d;
    box-shadow: 0 12px 25px rgba(253, 187, 45, 0.3);
    outline: none;
}

.date-filter select option {
    background-color: #1a2a6c;
    color: #fff;
    padding: 10px;
}

/* تنسيق زر العودة */
.btn-secondary {
    background: linear-gradient(45deg, #1a2a6c, #4a69bd);
    background-size: 200% 200%;
    color: white;
    border: none;
    cursor: pointer;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(26, 42, 108, 0.4);
    position: relative;
    overflow: hidden;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.btn-secondary::after {
    display: none;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #4a69bd, #1a2a6c);
    background-size: 200% 200%;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 35px rgba(26, 42, 108, 0.5), 0 0 15px rgba(74, 105, 189, 0.3);
    color: #fff;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(26, 42, 108, 0.4);
}

@media (max-width: 768px) {
    .filter-section {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-controls {
        justify-content: center;
        width: 100%;
    }
    
    .date-filter {
        width: 100%;
    }
    
    .date-filter select {
        width: 100%;
    }
    
    .btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }
}
