/* Additional styles for Egypt ETA Test Environment */

/* RTL Support */
.rtl {
    direction: rtl;
    text-align: right;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation for invoice cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.invoice-card {
    animation: fadeInUp 0.3s ease-out;
}

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

.loading-spinner .spinner-border {
    animation: spin 1s linear infinite;
}

/* Hover effects */
.btn-download:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #0056b3;
}

/* Status badges animation */
.status-badge {
    transition: all 0.3s ease;
}

.status-valid:hover {
    background-color: #c3e6cb;
    transform: scale(1.05);
}

.status-submitted:hover {
    background-color: #b8daff;
    transform: scale(1.05);
}

/* Search container enhancements */
.search-container {
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease;
}

.search-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Form controls */
.form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

/* Pagination styling */
.pagination .page-link {
    color: #2a5298;
    border-color: #dee2e6;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    color: #1e3c72;
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-color: #2a5298;
}

/* Test notice styling */
.test-notice {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .invoice-card .row {
        flex-direction: column;
    }
    
    .invoice-card .col-md-6 {
        margin-bottom: 10px;
    }
    
    .search-container .row {
        flex-direction: column;
    }
    
    .search-container .col-md-4 {
        margin-bottom: 15px;
    }
    
    .navbar-brand {
        font-size: 14px;
    }
    
    .main-container {
        padding: 15px;
        margin-top: 10px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .search-container,
    .pagination-container,
    .btn {
        display: none !important;
    }
    
    .invoice-card {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 2px solid #000;
    }
    
    .test-notice {
        display: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .main-container {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .invoice-card {
        background-color: #3d3d3d;
        border-color: #555;
    }
    
    .search-container {
        background-color: #2d2d2d;
        border-color: #555;
    }
    
    .form-control {
        background-color: #3d3d3d;
        border-color: #555;
        color: #ffffff;
    }
    
    .form-control:focus {
        background-color: #3d3d3d;
        border-color: #2a5298;
        color: #ffffff;
    }
}

/* Extension integration styles */
.extension-modal {
    z-index: 9999;
}

.extension-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.extension-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* Tooltip styles */
.tooltip-custom {
    position: relative;
    display: inline-block;
}

.tooltip-custom .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-custom:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Success/Error messages */
.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #bee5eb;
    color: #0c5460;
}

/* Loading states */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.page-link:focus {
    outline: 2px solid #2a5298;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .invoice-card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    .status-badge {
        border: 1px solid #000;
    }
}
