/**
 * SL Quick Access Tools Styles
 * Version: 2.0.0
 */

/* =============================================
   MAIN WIDGET STYLES
   ============================================= */

/* Container */
.slqat-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 100%;
    margin: 20px 0;
    border: 1px solid #e8ecef;
}

/* Header */
.slqat-header {
    margin-bottom: 28px;
}

.slqat-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.slqat-subtitle {
    font-size: 14px;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

/* Grid Layout */
.slqat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .slqat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .slqat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .slqat-grid {
        grid-template-columns: 1fr;
    }
    
    .slqat-container {
        padding: 20px;
    }
}

/* Individual Items */
.slqat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8ecef;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

.slqat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

/* Icons */
.slqat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.slqat-icon svg {
    width: 28px;
    height: 28px;
}

/* Icon Colors */
.slqat-icon-usd {
    background: linear-gradient(135deg, #10b981, #059669);
}

.slqat-icon-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.slqat-icon-cse {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.slqat-icon-btc {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.slqat-icon-petrol {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.slqat-icon-interest {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

/* Labels */
.slqat-label {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    text-transform: capitalize;
}

/* Values */
.slqat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    letter-spacing: -0.02em;
}

/* Change Indicator */
.slqat-change {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 8px;
}

.slqat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.slqat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Footer */
.slqat-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e8ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slqat-updated {
    font-size: 12px;
    color: #a0aec0;
}

.slqat-refresh-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4a5568;
    transition: all 0.2s ease;
}

.slqat-refresh-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.slqat-refresh-btn:active {
    transform: scale(0.98);
}

.slqat-refresh-btn svg {
    fill: currentColor;
}

.slqat-refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

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

/* Animation for value updates */
.slqat-value.updating {
    opacity: 0.5;
}

.slqat-value.updated {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #10b981; }
    100% { transform: scale(1); }
}

/* =============================================
   CHART STYLES
   ============================================= */

.slqat-chart-wrapper {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecef;
    margin: 20px 0;
}

.slqat-chart-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 20px 0;
}

.slqat-chart-controls-frontend {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.slqat-chart-controls-frontend select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
}

.slqat-chart-controls-frontend select:hover {
    border-color: #cbd5e0;
}

.slqat-chart-controls-frontend select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.slqat-chart-container {
    position: relative;
    width: 100%;
}

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

/* =============================================
   STATISTICS CARDS
   ============================================= */

.slqat-chart-stats {
    margin-top: 24px;
}

.slqat-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 992px) {
    .slqat-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .slqat-stats-grid {
        grid-template-columns: 1fr;
    }
}

.slqat-stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.slqat-stat-header {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.slqat-stat-current {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    margin-bottom: 8px;
}

.slqat-stat-change {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.slqat-stat-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.slqat-stat-change.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.slqat-stat-details {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
}

.slqat-stat-details span {
    white-space: nowrap;
}

/* =============================================
   HISTORY TABLE STYLES
   ============================================= */

.slqat-history-wrapper {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8ecef;
    margin: 20px 0;
}

.slqat-history-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 20px 0;
}

.slqat-history-stats {
    margin-bottom: 24px;
}

.slqat-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.slqat-history-table thead {
    background: #f8fafc;
}

.slqat-history-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.slqat-history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.slqat-history-table tbody tr:hover {
    background: #f8fafc;
}

.slqat-history-table td.positive {
    color: #059669;
    font-weight: 500;
}

.slqat-history-table td.negative {
    color: #dc2626;
    font-weight: 500;
}

.slqat-no-data {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-style: italic;
}

/* =============================================
   DARK MODE SUPPORT
   ============================================= */

@media (prefers-color-scheme: dark) {
    .slqat-container,
    .slqat-chart-wrapper,
    .slqat-history-wrapper {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .slqat-title,
    .slqat-chart-title,
    .slqat-history-title {
        color: #f7fafc;
    }
    
    .slqat-subtitle {
        color: #a0aec0;
    }
    
    .slqat-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .slqat-item:hover {
        border-color: #718096;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .slqat-label {
        color: #cbd5e0;
    }
    
    .slqat-value,
    .slqat-stat-current {
        color: #f7fafc;
    }
    
    .slqat-footer {
        border-color: #4a5568;
    }
    
    .slqat-updated {
        color: #718096;
    }
    
    .slqat-refresh-btn,
    .slqat-chart-controls-frontend select {
        background: #2d3748;
        border-color: #4a5568;
        color: #cbd5e0;
    }
    
    .slqat-refresh-btn:hover,
    .slqat-chart-controls-frontend select:hover {
        background: #4a5568;
        border-color: #718096;
    }
    
    .slqat-stat-card {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }
    
    .slqat-stat-header {
        color: #a0aec0;
    }
    
    .slqat-stat-details {
        color: #a0aec0;
    }
    
    .slqat-history-table thead {
        background: #2d3748;
    }
    
    .slqat-history-table th {
        color: #cbd5e0;
        border-color: #4a5568;
    }
    
    .slqat-history-table td {
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .slqat-history-table tbody tr:hover {
        background: #2d3748;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    .slqat-container,
    .slqat-chart-wrapper,
    .slqat-history-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .slqat-refresh-btn,
    .slqat-chart-controls-frontend {
        display: none;
    }
}

/* =============================================
   ELEMENTOR & DIVI COMPATIBILITY
   ============================================= */

.elementor-widget-container .slqat-container,
.elementor-widget-container .slqat-chart-wrapper,
.elementor-widget-container .slqat-history-wrapper {
    margin: 0;
}

.et_pb_module .slqat-container,
.et_pb_module .slqat-chart-wrapper,
.et_pb_module .slqat-history-wrapper {
    margin: 0;
}

/* =============================================
   ADMIN STYLES
   ============================================= */

.wrap .slqat-container {
    max-width: 900px;
}

.slqat-admin-charts {
    margin-top: 20px;
}

.slqat-chart-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
}

.slqat-chart-controls label {
    font-weight: 600;
    color: #475569;
}

.slqat-chart-controls select {
    min-width: 150px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Loading States */
.slqat-loading {
    position: relative;
}

.slqat-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Skeleton Loading */
.slqat-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

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

/* =============================================
   MINI SPARKLINE CHARTS
   ============================================= */

.slqat-sparkline {
    width: 100%;
    height: 40px;
    margin-top: 10px;
}

.slqat-sparkline canvas {
    width: 100% !important;
    height: 40px !important;
}

/* =============================================
   TOOLTIP STYLES
   ============================================= */

.slqat-tooltip {
    position: absolute;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slqat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e293b;
}

/* =============================================
   COMPARISON VIEW
   ============================================= */

.slqat-comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .slqat-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.slqat-comparison-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.slqat-comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.slqat-comparison-title {
    font-weight: 600;
    color: #1e293b;
}

.slqat-comparison-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.slqat-comparison-badge.up {
    background: #dcfce7;
    color: #166534;
}

.slqat-comparison-badge.down {
    background: #fee2e2;
    color: #991b1b;
}

/* =============================================
   RESPONSIVE CHART LEGEND
   ============================================= */

.slqat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.slqat-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.slqat-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.slqat-legend-color.usd { background: #10b981; }
.slqat-legend-color.gold { background: #f59e0b; }
.slqat-legend-color.cse { background: #3b82f6; }
.slqat-legend-color.btc { background: #f97316; }
