/* Components CSS - Additional UI Components */

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.notification[dir="ltr"] {
    font-family: 'Poppins', sans-serif;
}

.notification-success {
    background: var(--success-green);
}

.notification-error {
    background: var(--danger-red);
}

.notification-warning {
    background: var(--warning-yellow);
}

.notification-info {
    background: var(--primary-blue);
}

/* RTL Support for notifications */
[dir="rtl"] .notification {
    right: auto;
    left: 20px;
    transform: translateX(-100%);
}

[dir="rtl"] .notification.show {
    transform: translateX(0);
}

/* Enhanced Buttons */
.btn-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-sm);
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--text-lg);
    min-height: 56px;
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-blue);
    border: none;
}

.btn-ghost:hover {
    background: var(--neutral-lighter);
}

/* Loading States */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-lighter);
    transition: var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue-light);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--neutral-lighter);
    background: var(--bg-light);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--neutral-lighter);
    background: var(--bg-light);
}

/* Enhanced Form Elements */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating textarea {
    height: 56px;
    padding: 20px 15px 6px;
    border: 2px solid var(--neutral-lighter);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: var(--transition-normal);
}

.form-floating textarea {
    height: auto;
    min-height: 56px;
    resize: vertical;
}

.form-floating label {
    position: absolute;
    top: 18px;
    left: 15px;
    color: var(--neutral-medium);
    transition: var(--transition-normal);
    pointer-events: none;
    font-size: var(--text-base);
}

.form-floating input:focus,
.form-floating textarea:focus {
    border-color: var(--primary-blue-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-floating input:focus + label,
.form-floating textarea:focus + label,
.form-floating input:not(:placeholder-shown) + label,
.form-floating textarea:not(:placeholder-shown) + label {
    top: 8px;
    font-size: var(--text-sm);
    color: var(--primary-blue);
}

/* Enhanced Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-light);
    border: 2px solid var(--neutral-lighter);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--neutral-medium);
    font-size: var(--text-base);
}

.input-group input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: none;
}

.input-group input:focus {
    border-left: 2px solid var(--primary-blue-light);
}

/* Enhanced Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table th,
.table td {
    padding: var(--space-md);
    text-align: right;
    border-bottom: 1px solid var(--neutral-lighter);
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-blue);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

/* RTL Table Support */
[dir="ltr"] .table th,
[dir="ltr"] .table td {
    text-align: left;
}

/* Enhanced Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--neutral-lighter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: var(--primary-blue);
    font-size: var(--text-xl);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--neutral-medium);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.modal-close:hover {
    background: var(--neutral-lighter);
    color: var(--neutral-dark);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--neutral-lighter);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* Enhanced Alerts */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-green);
    color: var(--success-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-red);
    color: var(--danger-red);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-yellow);
    color: var(--warning-yellow);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-blue-light);
    color: var(--primary-blue-light);
}

/* Enhanced Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.badge-success {
    background: var(--success-green);
    color: var(--white);
}

.badge-warning {
    background: var(--warning-yellow);
    color: var(--white);
}

.badge-danger {
    background: var(--danger-red);
    color: var(--white);
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-dark);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Progress Bars */
.progress {
    width: 100%;
    height: 8px;
    background: var(--neutral-lighter);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-success .progress-bar {
    background: var(--success-green);
}

.progress-warning .progress-bar {
    background: var(--warning-yellow);
}

.progress-danger .progress-bar {
    background: var(--danger-red);
}

/* Enhanced Spinners */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-lighter);
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Utility Classes */
.text-primary { color: var(--primary-blue) !important; }
.text-success { color: var(--success-green) !important; }
.text-warning { color: var(--warning-yellow) !important; }
.text-danger { color: var(--danger-red) !important; }
.text-muted { color: var(--neutral-medium) !important; }

.bg-primary { background-color: var(--primary-blue) !important; }
.bg-success { background-color: var(--success-green) !important; }
.bg-warning { background-color: var(--warning-yellow) !important; }
.bg-danger { background-color: var(--danger-red) !important; }
.bg-light { background-color: var(--bg-light) !important; }

.border-primary { border-color: var(--primary-blue) !important; }
.border-success { border-color: var(--success-green) !important; }
.border-warning { border-color: var(--warning-yellow) !important; }
.border-danger { border-color: var(--danger-red) !important; }

/* Responsive Utilities */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: var(--space-md);
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .table {
        font-size: var(--text-sm);
    }
    
    .table th,
    .table td {
        padding: var(--space-sm);
    }
}

/* Print Styles */
@media print {
    .notification,
    .modal,
    .tooltip {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--neutral-dark);
    }
}

/* Floating Contact Widget */
.floating-contact-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.floating-contact-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.floating-contact-widget:hover .floating-contact-options,
.floating-contact-widget.active .floating-contact-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.floating-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white !important;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
    font-size: 24px;
}

.floating-btn:hover {
    transform: scale(1.1);
}

.floating-whatsapp {
    background-color: #25D366;
}

.floating-whatsapp:hover {
    background-color: #128C7E;
}

.floating-call {
    background-color: var(--primary-blue, #1E3A8A);
}

.floating-call:hover {
    background-color: #152C6B;
}

.floating-main-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue, #1E3A8A) 0%, #152C6B 100%);
    border: 3px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float-btn 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
}

.floating-main-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    animation: shine-btn 3s infinite;
}

@keyframes shine-btn {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes float-btn {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating-main-btn:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: white;
}

.floating-main-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
    border-radius: 50%;
}

.floating-main-btn:hover img {
    transform: scale(1.1);
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}

.floating-tooltip {
    position: absolute;
    right: 85px;
    bottom: 12px;
    background: white;
    color: var(--primary-blue, #1E3A8A);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(15px) translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 10;
}

.floating-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 12px;
    border-width: 8px 0 8px 10px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

.floating-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) translateY(0) scale(1);
}

[dir="rtl"] .floating-contact-widget {
    right: 20px;
    left: auto;
}

[dir="ltr"] .floating-contact-widget {
    right: 20px;
    left: auto;
}

