/* Report Page Specific Styles */

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Filter Card */
.filter-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-card h2 {
    font-size: 1.25rem;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.filter-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-success:hover {
    background: #40c057;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(81, 207, 102, 0.3);
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.summary-info {
    flex: 1;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Table Container */
.table-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.report-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.report-table th {
    padding: 15px;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.report-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.report-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.report-table td {
    padding: 15px;
    text-align: right;
    color: var(--text-primary);
}

.report-table tbody tr:last-child {
    border-bottom: none;
}

/* Movement Type Badge */
.movement-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.movement-badge.entry {
    background: rgba(81, 207, 102, 0.15);
    color: var(--secondary-color);
}

.movement-badge.exit {
    background: rgba(255, 107, 107, 0.15);
    color: var(--danger-color);
}

.movement-badge.unknown {
    background: rgba(108, 117, 125, 0.15);
    color: var(--text-secondary);
}

/* Toast Notification - JavaScript handles the styling via inline */
.toast {
    /* Base styles - position set by JS */
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

.toast.error {
    background: var(--danger-color);
    color: white;
}

.toast.warning {
    background: var(--warning-color);
    color: #333;
}

/* =============================================
   MOBILE RESPONSIVE STYLES FOR REPORTS
   ============================================= */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .page-header {
        margin-bottom: 20px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-description {
        font-size: 0.85rem;
    }

    .filter-card {
        padding: 20px;
        border-radius: 15px;
        margin-bottom: 20px;
    }

    .filter-card h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
        text-align: center;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .filter-item label {
        font-size: 0.85rem;
    }

    .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }

    .filter-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-summary {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .summary-card {
        padding: 18px;
        border-radius: 12px;
    }

    .summary-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .summary-value {
        font-size: 1.4rem;
    }

    .summary-label {
        font-size: 0.8rem;
    }

    .export-actions {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .export-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .table-container {
        padding: 15px;
        border-radius: 12px;
        overflow-x: auto;
    }

    .report-table {
        font-size: 0.75rem;
        min-width: 700px;
    }

    .report-table th,
    .report-table td {
        padding: 10px 8px;
    }

    /* Modal on mobile */
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 15px;
    }

    .attachments-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.2rem;
    }

    .filter-card {
        padding: 15px;
    }

    .filter-card h2 {
        font-size: 1rem;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .summary-card {
        padding: 15px;
        gap: 15px;
    }

    .summary-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .summary-value {
        font-size: 1.2rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .report-table {
        font-size: 0.7rem;
    }

    .report-table th,
    .report-table td {
        padding: 8px 6px;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .header,
    .footer,
    .filter-card,
    .export-actions {
        display: none !important;
    }

    .main-content {
        margin-right: 0 !important;
    }

    .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .report-table {
        font-size: 10pt;
    }

    body {
        background: white;
    }
}

/* Modal Styles for Report Page */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Attachments Grid */
.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.attachment-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    transition: transform 0.2s;
}

.attachment-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.attachment-preview-container {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.attachment-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    background-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Skeleton Loading Animation */
.img-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--border-color) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-secondary);
}

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

    100% {
        background-position: 200% 0;
    }
}

.attachment-preview.video-placeholder {
    opacity: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.attachment-preview.video-placeholder:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.attachment-preview.video-placeholder .play-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.attachment-preview.video-placeholder .video-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.attachment-footer {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.camera-badge {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-download-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(81, 207, 102, 0.1);
    color: var(--secondary-color);
    transition: all 0.2s;
}

.btn-download-icon:hover {
    background: var(--secondary-color);
    color: white;
}

/* Empty Attachments */
.no-attachments {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-attachments .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Custom Autocomplete */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 10px 10px;
    background-color: var(--card-bg);
    max-height: 200px;
    /* Fixed height! */
    overflow-y: auto;
    /* Scrollable! */
    box-shadow: var(--shadow-lg);
    display: none;
    /* Hidden by default */
}

.autocomplete-items.show {
    display: block;
    /* Show when .show class is added */
}

/* Custom Scrollbar for dropdown */
.autocomplete-items::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-items::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-items::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.autocomplete-items div {
    padding: 10px 12px;
    cursor: pointer;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.2s;
    text-align: right;
    /* RTL support */
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

.autocomplete-items div:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.autocomplete-active {
    background-color: rgba(102, 126, 234, 0.2) !important;
    color: var(--primary-color);
}

/* Today's Cars Section */
.autocomplete-header {
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    cursor: default;
    pointer-events: none;
}

.today-car {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Today's Cars - Professional Full-Width Design */
.todays-cars-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.todays-cars-header {
    margin-bottom: 25px;
}

.todays-cars-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.todays-cars-header h2 {
    font-size: 1.5rem;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.todays-cars-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

.todays-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.car-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.car-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s;
}

.car-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.car-card:hover::before {
    opacity: 1;
}

.car-card .car-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.car-card .car-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .todays-cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .car-card {
        padding: 15px 10px;
    }

    .car-card .car-number {
        font-size: 1.25rem;
    }
}

/* Full Page Loading Overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loading-content {
    text-align: center;
    color: var(--text-primary);
}

.page-loading-content h2 {
    margin-top: 25px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-loading-content p {
    margin-top: 10px;
    color: var(--text-secondary);
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}