/* Hanemira Trade Dashboard Styles */

/* Tab Navigation (White Background) */
.tab-button {
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #374151; /* gray-700 */
}

.tab-button:hover {
    background: #f3f4f6; /* gray-100 */
    color: #111827; /* gray-900 */
}

.tab-button.active {
    background: #e5e7eb; /* gray-200 */
    color: #111827; /* gray-900 */
    border-bottom: 3px solid #3b82f6; /* blue-500 */
}

/* Content Panels */
.content-panel {
    animation: fadeIn 0.3s ease-in-out;
}

.content-panel.hidden {
    display: none !important;
}

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

/* Data Table */
#dataTable {
    border-collapse: collapse;
}

#dataTable thead th {
    background-color: #000000;
    color: #ffffff;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border: none;
}

#dataTable tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

#dataTable tbody tr:hover {
    background-color: #f9fafb;
}

#dataTable tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

#dataTable tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

/* Filter Panel */
#filterPanel {
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
}

/* Vertical Filter Tab */
#filterTab .writing-mode-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    line-height: 1.2;
}

/* Fixed Header Group */
body {
    overflow-x: hidden;
}

/* Header group fixed positioning */
.fixed-header-group {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
}

/* Ensure proper header height calculation */
.header-spacer {
    height: 128px; /* Hanemira header (56px) + Tab nav (44px) + Summary bar (28px) */
}

/* Sidebar positioning below tab navigation */
.sidebar-below-tabs {
    top: 102px; /* Hanemira header (56px) + Tab nav (46px) */
    height: calc(100vh - 102px);
}

/* Sidebar Menu */
#sidebarMenu {
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

/* Selection Tags */
.filter-tag {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 2px;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: #bfdbfe;
}

.filter-tag button {
    background: none;
    border: none;
    color: #1e40af;
    padding: 2px;
    margin: 0;
    cursor: pointer;
    font-size: 0.625rem;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.filter-tag button:hover {
    background: #3b82f6;
    color: white;
}

/* Tag container minimum height */
.min-h-6 {
    min-height: 1.5rem;
}

/* Select dropdown enhancement */
select optgroup {
    font-weight: bold;
    color: #374151;
    background: #f9fafb;
}

select option {
    padding: 8px 12px;
}

/* Improved multi-select containers */
.tag-container {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px;
    min-height: 32px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.tag-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dropdown Enhancements */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* Header Enhancements */
header {
    border-bottom: 1px solid #374151;
}

/* Data Summary Bar */
#dataSummaryBar {
    font-family: monospace;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* File Upload Area */
.file-upload-area {
    transition: all 0.2s ease;
}

.file-upload-area:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.file-upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Button Enhancements */
button:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

button:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.bg-white:hover {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Responsive Design */
@media (max-width: 768px) {
    #sidebarMenu {
        width: 100%;
    }
    
    #filterPanel {
        width: 100%;
    }
    
    .tab-button {
        font-size: 0.75rem;
        padding: 12px 16px;
    }
    
    #dataSummaryBar {
        font-size: 0.75rem;
    }
    
    #dataTable {
        font-size: 0.75rem;
    }
    
    #dataTable th,
    #dataTable td {
        padding: 8px 12px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

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

/* Overlay */
#overlay {
    backdrop-filter: blur(2px);
}

/* Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

.toast.info {
    background-color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Chart Containers */
canvas {
    max-height: 400px;
}

/* Focus States */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Selection Styles */
::selection {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    #sidebarMenu,
    #filterPanel,
    #filterTab {
        display: none !important;
    }
}