/* Trademark Dashboard Styles */

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

body {
    font-family: 'Open Sans', sans-serif;
    background: #f5f7fa;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    max-width:240px;
    margin-bottom: 15px;
}

.client-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.client-name span {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-top: 5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: #3498db;
}

.nav-item.active {
    background: rgba(52, 152, 219, 0.2);
    color: #fff;
    border-left-color: #3498db;
}

.nav-item i {
    font-size: 1.3rem;
    margin-right: 15px;
    width: 25px;
}

.nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: rgba(231, 76, 60, 0.2);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-logout i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 0;
}

.content-header {
    background: #fff;
    padding: 25px 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.header-actions .btn {
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
}

.content-body {
    padding: 30px 40px;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* ========== Stat Cards ========== */
.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stat-icon i {
    font-size: 1.8rem;
    color: #fff;
}

.stat-icon.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.bg-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-details h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.stat-details p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
}

/* ========== Info Cards ========== */
.info-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.info-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f7fa;
}

.info-card h4 i {
    margin-right: 10px;
    color: #3498db;
}

.info-item {
    margin-bottom: 15px;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-item span,
.info-item p {
    display: block;
    font-size: 1rem;
    color: #2c3e50;
}

/* ========== Documents List ========== */
.document-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.document-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.document-icon {
    width: 40px;
    height: 40px;
    background: #3498db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.document-icon i {
    font-size: 1.2rem;
    color: #fff;
}

.document-info {
    flex: 1;
}

.document-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.document-info p {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin: 0;
}

.document-actions a {
    padding: 8px 15px;
    background: #3498db;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.document-actions a:hover {
    background: #2980b9;
}

/* ========== Image Gallery ========== */
/* تم تعطيل .image-gallery grid layout لاستخدام Bootstrap grid من JavaScript */

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-item {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay a {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 10px;
}

/* ========== Table ========== */
.table {
    background: #fff;
}

.table thead th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    color: #2c3e50;
    vertical-align: middle;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ========== Timeline ========== */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #3498db;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timeline-date {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.timeline-content h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.timeline-content p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
}

/* ========== Case Timeline Scrollbar ========== */
.case-timeline-body::-webkit-scrollbar {
    width: 8px;
}

.case-timeline-body::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.case-timeline-body::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.case-timeline-body::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ========== Documents Section Scrollbar ========== */
#case-docs-box::-webkit-scrollbar,
.case-documents-box > div[id*='case-docs']::-webkit-scrollbar {
    width: 8px;
}

#case-docs-box::-webkit-scrollbar-track,
.case-documents-box > div[id*='case-docs']::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

#case-docs-box::-webkit-scrollbar-thumb,
.case-documents-box > div[id*='case-docs']::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 4px;
}

#case-docs-box::-webkit-scrollbar-thumb:hover,
.case-documents-box > div[id*='case-docs']::-webkit-scrollbar-thumb:hover {
    background: #d35400;
}

/* ========== Images Section Scrollbar ========== */
#case-imgs-box::-webkit-scrollbar,
.case-images-box > div[id*='case-imgs']::-webkit-scrollbar {
    width: 8px;
}

#case-imgs-box::-webkit-scrollbar-track,
.case-images-box > div[id*='case-imgs']::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

#case-imgs-box::-webkit-scrollbar-thumb,
.case-images-box > div[id*='case-imgs']::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

#case-imgs-box::-webkit-scrollbar-thumb:hover,
.case-images-box > div[id*='case-imgs']::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ========== Map Styles (legacy dashboard.html) ========== */
#mapContainer:not(.map-section-map) {
    position: relative;
    width: 100% !important;
    height: 600px !important;
    z-index: 1;
}

#mapContainer:not(.map-section-map) .mapboxgl-map {
    width: 100% !important;
    height: 100% !important;
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

.mapboxgl-popup-content-wrapper {
    border-radius: 8px;
}

.mapboxgl-popup-content {
    margin: 10px 12px;
}

/* Map Legend Styles */
#mapLegend {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#mapLegend h5 {
    font-weight: 700 !important;
    font-size: 20px !important;
    color: #2c3e50 !important;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px !important;
}

#locationsList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 18px;
}

#locationsList > div {
    padding: 18px 24px;
    background: white;
    border-radius: 12px;
    border-left: 6px solid;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    font-weight: 600;
}

#locationsList > div:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

#locationsList > div strong {
    font-size: 18px;
    font-weight: 800;
    display: block;
    margin-bottom: 10px;
    color: #2c3e50;
}

#locationsList > div small {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    display: block;
    margin-top: 5px;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header,
    .content-body {
        padding: 20px;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .image-gallery {
        grid-template-columns: 1fr;
    }
}

/* ========== Invoice Modal Animation ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

/* Keyboard support for modal */
.modal {
    outline: none;
}

.close:focus {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}

/* ========== Download Button Animation ========== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* React map section — full viewport beside sidebar */
.main-content.main-content--map-full {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.main-content.main-content--map-full .content-body {
    padding: 0 !important;
    overflow: hidden;
}

.map-section-full {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 280px;
    z-index: 50;
    overflow: hidden;
}

.map-section-map {
    position: absolute;
    inset: 0;
}

.map-section-map,
.map-section-map .mapboxgl-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

@media (max-width: 900px) {
    .map-section-full {
        left: 0;
    }
}
