/* =====================
   Global Form Styles - إزالة السهم المزدوج
====================== */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-select::-ms-expand {
    display: none;
}

/* =====================
   Edit Dialog Loading
====================== */
.edit-upload-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 0 1rem 0;
    min-height: 220px;
}
.edit-loader-visual {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}
.edit-loader-svg {
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}
.edit-loader-bg {
    stroke: #f0f0f0;
}
.edit-loader-bar {
    stroke: #d4af37;
    transition: stroke-dashoffset 0.4s cubic-bezier(.4,2,.6,1);
}
.edit-loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    color: #d4af37;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(212,175,55,0.08);
    padding: 0.5rem;
}
.edit-loader-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.edit-loader-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
}
.edit-loader-filename {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    direction: ltr;
    text-align: left;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.edit-loader-progress-text {
    font-size: 1.2rem;
    color: #d4af37;
    font-weight: 700;
    letter-spacing: 1px;
}
@media (max-width: 600px) {
    .edit-upload-loading {
        padding: 1rem 0 0.5rem 0;
        min-height: 120px;
    }
    .edit-loader-visual {
        width: 54px;
        height: 54px;
    }
    .edit-loader-svg {
        width: 54px;
        height: 54px;
    }
    .edit-loader-icon {
        font-size: 1.3rem;
        padding: 0.3rem;
    }
    .edit-loader-filename {
        max-width: 120px;
        font-size: 0.85rem;
    }
    .edit-loader-title {
        font-size: 1rem;
    }
    .edit-loader-progress-text {
        font-size: 1rem;
    }
}
/* ===============================================
   بنك حضرموت - تنسيقات عامة
   Hadhramout Bank - General Styles
   =============================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* إزالة focus outline الافتراضي */
*:focus,
*:focus-visible,
a:focus,
button:focus,
div:focus {
    outline: none !important;
}

/* للوصولية - إضافة shadow خفيف للعناصر التفاعلية فقط عند الحاجة */
button:focus-visible:not(:disabled),
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3) !important;
}

html, body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
}

.hb-main-content {
    min-height: calc(100vh - 60px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 30px;
    }
}

/* Blazor Error Boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #b32121 0%, #d32f2f 100%);
    padding: 1.5rem 2rem;
    color: white;
    border-radius: 10px;
    margin: 2rem;
    box-shadow: 0 4px 12px rgba(179, 33, 33, 0.3);
}

.blazor-error-boundary::after {
    content: "⚠️ حدث خطأ في التطبيق";
    font-weight: 600;
    font-size: 1.1rem;
}

.blazor-error-boundary .reload {
    color: #d4af37;
    text-decoration: underline;
    margin-right: 1rem;
    font-weight: 600;
}

.blazor-error-boundary .reload:hover {
    color: white;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: linear-gradient(135deg, #b32121 0%, #d32f2f 100%);
    color: white;
    padding: 1.5rem;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 10000;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(179, 33, 33, 0.4);
    display: none;
    align-items: center;
    gap: 1rem;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#blazor-error-ui[data-nosnippet] {
    display: flex;
}

#blazor-error-ui .reload {
    background: white;
    color: #b32121;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

#blazor-error-ui .reload:hover {
    background: #d4af37;
    color: white;
    transform: scale(1.05);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-right: auto;
    font-size: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

/* Focus Outline */
h1:focus {
    outline: 2px solid #d4af37;
    outline-offset: 4px;
}

/* Form Validation */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid #26b050;
    outline-offset: 2px;
}

.invalid {
    outline: 2px solid #e50000;
    outline-offset: 2px;
}

.validation-message {
    color: #e50000;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    font-weight: 500;
}

/* Placeholder Styles */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: #999;
    text-align: end;
    transition: all 0.3s ease;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
    opacity: 0.7;
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 61, 122, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Checkbox Styles */
.darker-border-checkbox.form-check-input {
    border-color: #003d7a;
    border-width: 2px;
}

.darker-border-checkbox.form-check-input:checked {
    background-color: #003d7a;
    border-color: #003d7a;
}

/* Utility Classes */
.text-primary-hb {
    color: #003d7a !important;
}

.text-gold-hb {
    color: #d4af37 !important;
}

.bg-primary-hb {
    background-color: #003d7a !important;
}

.bg-gold-hb {
    background-color: #d4af37 !important;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    html, body {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 12px;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* RTL Input for Mobile Number - Global Override */
input[type="tel"],
input.form-control[type="tel"] {
    direction: rtl !important;
    text-align: right !important;
}

input[type="tel"]::placeholder {
    direction: rtl !important;
    text-align: right !important;
}

/* ===============================================
   نوافذ التعديل والمعاينة
   Edit & Preview Modals
   =============================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Edit Modal */
.edit-modal,
.confirm-modal,
.preview-modal {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirm-modal {
    max-width: 500px;
}

.preview-modal {
    max-width: 900px;
}

/* Modal Header */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.modal-title i {
    color: #d4af37;
    font-size: 1.6rem;
}

.btn-close-modal {
    background: rgba(220, 53, 69, 0.1);
    border: none;
    color: #dc3545;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close-modal:hover {
    background: #dc3545;
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.preview-body {
    padding: 1rem;
}

/* Current File Info */
.current-file-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-header i {
    color: #d4af37;
    font-size: 1.3rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 100px;
}

.info-value {
    color: #2c3e50;
    flex: 1;
    word-break: break-word;
}

/* File Preview Section */
.file-preview-section {
    margin-bottom: 1.5rem;
}

.image-preview {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pdf-preview-info {
    background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
    border: 2px dashed #d4af37;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    color: #856404;
}

.pdf-preview-info i {
    font-size: 4rem;
    color: #d4af37;
    margin-bottom: 1rem;
}

.pdf-preview-info p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Upload New File Section */
.upload-new-file-section {
    background: #ffffff;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    padding: 1.5rem;
}

.upload-new-file-section .section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-new-file-section .section-title i {
    color: #d4af37;
}

.edit-drop-zone {
    border: 3px dashed #d4af37;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fffef7 0%, #ffffff 100%);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-drop-zone:hover:not(.processing) {
    border-color: #b8941f;
    background: linear-gradient(135deg, #fffcf0 0%, #fffef7 100%);
    transform: translateY(-2px);
}

.edit-drop-zone.processing {
    cursor: not-allowed;
    opacity: 0.7;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.drop-zone-content i {
    font-size: 3rem;
    color: #d4af37;
}

.drop-zone-content .main-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.drop-zone-content .hint-text {
    font-size: 0.9rem;
    color: #6c757d;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.processing-indicator .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-small {
    width: 200px;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #b8941f 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.new-file-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.new-file-selected i {
    font-size: 3rem;
    color: #28a745;
}

.new-file-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.new-file-name {
    font-weight: 600;
    color: #2c3e50;
}

.new-file-size {
    font-size: 0.9rem;
    color: #6c757d;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message i {
    font-size: 1.2rem;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: #f8f9fa;
}

.modal-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.modal-footer .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Confirm Modal Specific */
.warning-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffc107 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.warning-icon i {
    font-size: 2rem;
    color: #856404;
}

.confirm-message {
    font-size: 1.1rem;
    color: #2c3e50;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.warning-note {
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #856404;
}

.warning-note i {
    font-size: 1.2rem;
}

/* Preview Modal Specific */
.preview-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.preview-info h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.preview-filename {
    color: #6c757d;
    font-size: 0.95rem;
}

.preview-image-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.preview-pdf-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px dashed #2196f3;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    color: #1565c0;
}

.preview-pdf-info i {
    font-size: 5rem;
    color: #2196f3;
    margin-bottom: 1rem;
}

.preview-pdf-info p {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Summary List Enhancements */
.summary-filesize {
    font-size: 0.85rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
    margin-right: auto;
}

.btn-view-file,
.btn-edit-file {
    background: transparent;
    border: 2px solid #e9ecef;
    color: #6c757d;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-view-file:hover {
    background: #2196f3;
    border-color: #2196f3;
    color: white;
    transform: translateY(-2px);
}

.btn-edit-file:hover {
    background: #d4af37;
    border-color: #d4af37;
    color: white;
    transform: translateY(-2px);
}

.btn-view-file i,
.btn-edit-file i {
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .edit-modal,
    .confirm-modal,
    .preview-modal {
        max-height: 95vh;
    }

    .modal-header {
        padding: 1rem 1.5rem;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .summary-actions {
        flex-direction: column;
    }

    .preview-image-container img {
        max-height: 300px;
    }
}
