/* MIT PV.dk Complete CSS with Tailwind classes */

/* Tailwind Base Styles */
* {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-feature-settings: normal;
  font-variation-settings: normal;
}

body {
  margin: 0;
  line-height: inherit;
}

/* Utility Classes */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 1200px;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.ml-2 { margin-left: 0.5rem; }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-yellow-50 { background-color: #fefce8; }
.bg-red-50 { background-color: #fef2f2; }
.bg-purple-50 { background-color: #faf5ff; }

/* Text Colors */
.text-gray-800 { color: #1f2937; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.text-green-800 { color: #166534; }
.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }
.text-yellow-800 { color: #92400e; }
.text-red-800 { color: #991b1b; }
.text-purple-800 { color: #6b21a8; }

/* Text Sizes */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

/* Font Weights */
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Layout */
.flex { display: flex; }
.grid { display: grid; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

.text-center { text-align: center; }

.min-h-screen { min-height: 100vh; }
.h-96 { height: 24rem; }

/* Borders and Shadows */
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.shadow-md { 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
}

/* Responsive Design */
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Custom Components */
.kpi-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.energy-flow {
    position: relative;
}

.energy-arrow {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6);
    border-radius: 1px;
}

.energy-arrow::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -2px;
    width: 0;
    height: 0;
    border-left: 6px solid #3b82f6;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
}

/* Navigation Styles */
.header {
    background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

.solar-panel-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #86efac;
}

/* Mobile Navigation */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-button {
        display: block;
    }
    
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-standby {
    background-color: #fef3c7;
    color: #92400e;
}

.status-error {
    background-color: #fecaca;
    color: #991b1b;
}

/* Chart Styles */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Loading animation */
.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Performance indicators */
.performance-good { color: #10b981; }
.performance-medium { color: #f59e0b; }
.performance-poor { color: #ef4444; }

/* Animation for value updates */
.value-update {
    animation: pulse-green 0.5s ease-in-out;
}

@keyframes pulse-green {
    0% { 
        background-color: rgba(16, 185, 129, 0.1); 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(16, 185, 129, 0.3); 
        transform: scale(1.02);
    }
    100% { 
        background-color: transparent; 
        transform: scale(1);
    }
}
