/* Import FC-Iconic-KHOR font */
@font-face {
    font-family: 'FC-Iconic-KHOR';
    src: url('FC Iconic-KHOR/TTF Files/FCIconic-KHOR-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FC-Iconic-KHOR';
    src: url('FC Iconic-KHOR/TTF Files/FCIconic-KHOR-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'FC-Iconic-KHOR', Arial, sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #333;
}

.header {
    background: white;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 5px;
}

.logo {
    height: 65px;
    width: auto;
}

.title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.business-info {
    margin-left: auto;
    text-align: right;
    font-size: 14px;
    color: #6b7280;
}

.time-info {
    margin-top: 8px;
    font-size: 12px;
    color: #5c5c5c;
}

.time-info span {
    display: block;
    margin-bottom: 2px;
}

.business-name {
    font-weight: 600;
    color: #000000;
}

.dashboard {
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
}

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

/* Mobile: Single column */
@media (max-width: 768px) {
    .dashboard {
        padding: 15px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card-content {
        height: 250px;
    }
    
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .business-info {
        margin-left: 0;
        text-align: center;
    }
    
    .logo {
        height: 40px;
    }
    
    .title {
        font-size: 20px;
    }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1025px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .card-content {
        height: 350px;
    }
}

/* Large Desktop: 3 columns with larger cards */
@media (min-width: 1440px) {
    .dashboard {
        padding: 30px;
    }
    
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .card {
        padding: 25px;
    }
    
    .card-content {
        height: 400px;
    }
}

.card {
    background: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    min-height: 60px;
}

.header-text {
    flex: 1;
    line-height: 1.2;
}

.header-text div:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
}

.header-text div:last-child {
    
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
}

.card-content {
    height: 300px;
    position: relative;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.waste-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.waste-total-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.waste-total-label {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.waste-total-unit {
    font-size: 20px;
    color: #6b7280;
}

.waste-bottom-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    margin-top: auto;
}

.waste-total-value {
    font-size: 60px;
    font-weight: bold;
    color: #1f2937;
    text-align: right;
    margin-top: 3rem;
}

.waste-breakdown-bar {
    display: flex;
    width: 100%;
    height: 20px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #c1c1c1;
    background-color: #f9fafb;
}

.breakdown-segment {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breakdown-segment:first-child {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.breakdown-segment:last-child {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.breakdown-percentage {
    font-size: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.breakdown-percentages {
    display: flex;
    text-align: left;
    margin-top: -1rem;
    width: 100%;
}

.breakdown-percentage-label {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
    flex-shrink: 0;
}

.waste-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.waste-item-label {
    font-size: 14px;
    color: #1f2937;
}

.waste-item-unit {
    font-size: 12px;
    color: #6b7280;
}

.waste-item-value {
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
    text-align: right;
    margin-bottom: 5px;
}

.waste-item-percentage {
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 15px;
}

.waste-item-progress {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: absolute;
    bottom: 0;
    left: 0;
}

.waste-breakdown-container {
    position: relative;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 20px 0;
}

.waste-breakdown-container.fade-in {
    opacity: 1;
}

.waste-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.auto-rotate-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #c1c1c1;
    margin-top: 8px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #000000;
    height: 60px;
}

.countdown-clock {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: conic-gradient(#6b7280 0deg, #e5e7eb 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #1f2937;
    font-weight: bold;
    transition: background 0.1s ease;
}

.info-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #c1c1c1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.info-icon:hover {
    background: #939393;
}

.carbon-tooltip {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 400px;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip-header {
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.tooltip-content {
    max-height: 300px;
    overflow-y: auto;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 4px 0;
}

.tooltip-row .category {
    flex: 2;
    color: #374151;
}

.tooltip-row .factor {
    flex: 1;
    color: #059669;
    font-weight: 500;
    text-align: center;
}

.tooltip-row .method {
    flex: 1;
    color: #6b7280;
    font-size: 11px;
    text-align: right;
}

.tooltip-footer {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-weight: 500;
    color: #1f2937;
    text-align: center;
}

/* Apply FC-Iconic-KHOR font to all chart elements */
canvas {
    font-family: 'FC-Iconic-KHOR', Arial, sans-serif !important;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.carbon-footprint {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 18px;
    color: #6b7280;
    font-style: italic;
}

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

.chart-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-right: 160px; /* More room for side legend */
}

.chart-side-legend {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: #374151;
    max-width: 140px;
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.legend-text {
    font-family: 'FC-Iconic-KHOR', sans-serif;
    width: 120px;
    text-align: left;
    line-height: 1.2;
}

.legend-category {
    font-weight: 600;
    font-size: 11px;
    color: #374151;
    margin-bottom: 2px;
}

.legend-values {
    font-size: 10px;
    color: #6b7280;
}

.error {
    color: #dc2626;
    text-align: center;
    padding: 20px;
}

.auto-rotate {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    padding: 4px 8px;
    border-radius: 4px;
}

.language-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.lang-flag:hover {
    background: rgba(255, 255, 255, 1);
    color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-flag:active {
    transform: translateY(0);
}
