/* ATM Specific Styles */

/* App Header Overrides */
.app-name {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 14px;
    color: var(--text-main);
}

.app-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.back-link {
    color: var(--hex-blue);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin-right: 20px;
}

.profile-info {
    text-align: right;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hex-logo {
    width: 42px;
    height: 36px;
    background: var(--text-main);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-bg);
    font-weight: 800;
    font-size: 20px;
}

/* Filter Panel Tweaks */
.filter-panel {
    margin: 24px 32px 0 32px;
    padding: 16px 24px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hex-toggles {
    display: flex;
    gap: 8px;
}

.hex-toggle {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.hex-toggle.active {
    background: var(--hex-blue);
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.hex-toggle:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: none;
    padding: 6px 16px;
    position: relative;
    transition: all 0.2s;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.date-input-group::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(0, 0, 0, 0.3);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    z-index: -1;
}

.date-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    width: 90px;
}

.separator {
    color: var(--text-muted);
}

.city-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.15);
    border: none;
    padding: 6px 16px;
    position: relative;
    transition: all 0.2s;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    width: 200px;
}

.city-select-group::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(0, 0, 0, 0.3);
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
    z-index: -1;
}

.city-select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    width: 100%;
    cursor: pointer;
}

.city-select option {
    background: var(--dark-bg);
    color: var(--text-main);
}

.btn-refresh {
    width: 52px;
    height: 44px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--hex-blue);
    color: var(--hex-blue);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

.btn-refresh:hover {
    background: var(--hex-blue);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-left: 16px;
}

.status-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s;
}

/* Section Header */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 40px 32px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 200px;
    height: 1px;
    background: var(--hex-blue);
    box-shadow: 0 0 10px var(--hex-blue);
}

.header-icon {
    width: 32px;
    height: 28px;
    background: var(--hex-blue);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-module {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border-color);
    position: relative;
    padding: 24px;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

.kpi-module::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='34' viewBox='0 0 20 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0l10 5.77v11.55L10 23.1 0 17.32V5.77L10 0zm0 34l-10-5.77V16.68l10 5.77 10-5.77v11.55L10 34z' fill='%233b82f6' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
}

.module-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--hex-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.module-metric {
    font-family: 'JetBrains Mono', monospace;
    font-size: 42px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.module-metric::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 90px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}

.module-sub {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Chart Layouts */
.chart-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

@media (max-width: 1000px) {
    .chart-row {
        flex-direction: column;
    }

    .chart-container {
        width: 100% !important;
    }
}

.chart-container canvas {
    min-height: 300px;
    max-height: 400px;
    width: 100%;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    position: relative;
    display: inline-block;
    min-width: 400px;
}

.dropdown-button {
    width: 100%;
    padding: 10px 15px;
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.dropdown-button:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: var(--hex-primary);
}

.dropdown-arrow {
    color: var(--hex-primary);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111827;
    border: 1px solid var(--hex-primary);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.dropdown-item.all-toggle {
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.dropdown-item.all-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
}

.dropdown-item.scheme-toggle {
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.dropdown-item.scheme-toggle:hover {
    background: rgba(59, 130, 246, 0.15);
}

.dropdown-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--hex-primary);
}

.dropdown-item span {
    flex: 1;
}

.dropdown-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

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

.dropdown-content::-webkit-scrollbar-track {
    background: #1f2937;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--hex-primary);
    border-radius: 4px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-primary);
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background-color: rgba(17, 24, 39, 0.8);
    color: var(--hex-primary);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

th:hover {
    background-color: rgba(31, 41, 55, 0.8);
}

th.sortable::after {
    content: ' ⇅';
    position: absolute;
    right: 8px;
    opacity: 0.5;
}

th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
}

th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
}

tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    cursor: pointer;
}

td strong {
    color: var(--hex-primary);
}