@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Admin Header */
.admin-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

/* Create Link Section */
.create-link-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 48px;
    border: 1px solid var(--border-color);
}

.create-link-section h2 {
    color: var(--text-primary);
    margin-bottom: 28px;
    font-size: 1.5rem;
    font-weight: 600;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.form-group input {
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    direction: rtl;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
}

.form-group input:hover {
    border-color: var(--primary-light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group.small {
    flex: 1;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

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

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

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

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

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #c82333;
}


.btn-pay {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1.25rem;
    padding: 18px 40px;
    width: 100%;
    max-width: 400px;
    margin: 32px auto;
    display: block;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-amount {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-amount:hover {
    background: var(--primary-dark);
}

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

.btn-cancel:hover {
    background: #dc2626;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-copy {
    background: var(--text-secondary);
    color: white;
    padding: 10px 18px;
    font-size: 0.9rem;
    margin-right: 12px;
}

.btn-copy:hover {
    background: var(--text-primary);
}

/* Links Section */
.links-section {
    margin-top: 48px;
}

.links-section h2 {
    color: var(--text-primary);
    margin-bottom: 28px;
    font-size: 1.5rem;
    font-weight: 600;
}

.links-list {
    display: grid;
    gap: 20px;
}

.link-card {
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.2s ease;
}

.link-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.link-info p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.link-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.link-url {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.link-url input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    direction: ltr;
    text-align: left;
    background: var(--bg-secondary);
    font-family: 'Courier New', monospace;
}

.no-links {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 48px;
}

.admin-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1.5px solid var(--border-color);
}

/* Invoice Container */
.invoice-container {
    max-width: 600px;
    text-align: center;
}

.invoice-header {
    margin-bottom: 48px;
}

.invoice-header h1 {
    color: var(--text-primary);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.foundation-name {
    color: var(--text-secondary);
    font-size: 1.15rem;
    font-weight: 500;
}

.invoice-body {
    padding: 32px;
}

.amount-section {
    margin: 32px 0;
}

.amount-label {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.amount-value {
    color: var(--primary-color);
    font-size: 3rem;
    font-weight: 700;
    margin: 12px 0;
    letter-spacing: -1px;
}

.expiry-section {
    margin: 28px 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.divider {
    border: none;
    border-top: 1.5px solid var(--border-color);
    margin: 32px 0;
}

.from-to-section {
    text-align: right;
    margin: 32px 0;
}

.from, .to {
    font-size: 1.1rem;
    margin: 16px 0;
    color: var(--text-secondary);
}

.from strong, .to strong {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.pay-button-section {
    margin-top: 48px;
}

/* Payment Status Section */
.payment-status-section {
    margin-top: 48px;
}

.status-card {
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid;
    animation: fadeIn 0.5s ease;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.status-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.status-card p {
    font-size: 1.1rem;
    margin-top: 8px;
}

.status-completed {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.status-waiting {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.status-pending {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

/* Language Toggle */
.lang-toggle {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

.lang-btn {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
    box-shadow: var(--shadow-sm);
}

.lang-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Payment Form Container */
.payment-form-container {
    max-width: 700px;
}

.company-logo-section {
    text-align: center;
    margin-bottom: 48px;
}

.logo-placeholder {
    margin: 0 auto 24px;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-primary);
}

.company-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-logo-section h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.payment-title {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.card-details-section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.card-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-logos {
    display: flex;
    gap: 12px;
    align-items: center;
}

.card-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.9;
    transition: all 0.2s ease;
}

.card-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 28px;
}

/* Error Message */
.error-message {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--danger-color);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    font-weight: 500;
}

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

/* OTP Container */
.otp-container {
    max-width: 500px;
}

.otp-header {
    text-align: center;
    margin-bottom: 48px;
}

.otp-header h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.otp-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.otp-form {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.otp-result {
    margin-top: 32px;
    padding: 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

#successButtons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.result-message {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 16px;
    border-radius: var(--radius-md);
}

.result-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1.5px solid #10b981;
}

.result-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #ef4444;
}

/* Waiting Message */
.waiting-message {
    text-align: center;
    padding: 24px;
}

.waiting-message p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Small buttons for admin */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    margin: 0 4px;
}

/* OTP Code display */
.otp-code {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Waiting status badge */
.status-badge.waiting {
    background: #fef3c7;
    color: #92400e;
}

.text-muted {
    color: var(--text-light);
    font-style: italic;
}

/* Sensitive Data */
.sensitive-data {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.sensitive-data .hidden-value {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
    position: relative;
}

.sensitive-data .hidden-value::after {
    content: '🔒';
    margin-right: 6px;
    font-size: 0.9em;
    opacity: 0.6;
}

.sensitive-data .hidden-value:hover {
    background: var(--border-color);
    transform: scale(1.05);
    cursor: pointer;
}

.sensitive-data .hidden-value:hover::after {
    opacity: 1;
}

.sensitive-data .revealed-value {
    display: inline-block;
    padding: 6px 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    border: 1.5px solid #10b981;
}

/* Password Modal */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.password-modal-content {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.password-modal-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.password-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
    font-size: 0.95rem;
}

.password-modal-content input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: 20px;
    direction: ltr;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    transition: all 0.2s ease;
}

.password-modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.password-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.password-modal-actions .btn {
    flex: 1;
    max-width: 150px;
}

.password-error {
    margin-top: 16px;
    padding: 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1.5px solid #ef4444;
}

/* Dashboard */
.dashboard-section {
    margin-top: 32px;
}

.dashboard-section h2 {
    color: var(--text-primary);
    margin-bottom: 28px;
    font-size: 1.5rem;
    font-weight: 600;
}

.cards-table {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

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

thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

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

th {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

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

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.2px;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.verified {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #991b1b;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 48px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 24px;
        border-radius: var(--radius-lg);
    }
    
    .admin-header h1 {
        font-size: 1.75rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .card-details-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    .lang-toggle {
        top: 12px;
        left: 12px;
    }
    
    .lang-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .amount-value {
        font-size: 2.25rem;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading state for buttons */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Login Page */
.login-container {
    max-width: 450px;
    margin-top: 100px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-form {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}
/* تأكيد تفاعل الأزرار */
button {
    pointer-events: auto !important;
    position: relative;
    z-index: 9999 !important;
}

/* إلغاء أي طبقة وهمية فوق الجدول */
.cards-table::before,
.cards-table::after,
.container::before,
.container::after {
    display: none !important;
}

/* لو في overlay أو loader */
.overlay,
.loader,
.modal-backdrop {
    pointer-events: none !important;
    display: none !important;
}
