/* ============================================
   WATT HUB Admin - Design System
   Matching Energetika User Application Theme
   ============================================ */

/* --- Design System Variables --- */
:root {
    /* Smooth, Saturated Gradients - Match User App */
    --grad-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-solar: linear-gradient(135deg, #FFD93D 0%, #FF8C42 100%);
    --grad-consumer: linear-gradient(135deg, #6DD5FA 0%, #2980B9 100%);
    --grad-group: linear-gradient(135deg, #A8E6CF 0%, #3DBE8D 100%);
    --grad-energy: linear-gradient(135deg, #FF9A9E 0%, #FAD0C4 100%);
    --grad-admin: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-warning: linear-gradient(135deg, #FFD93D 0%, #FF8C42 100%);
    --grad-success: linear-gradient(135deg, #A8E6CF 0%, #3DBE8D 100%);
    --grad-info: linear-gradient(135deg, #6DD5FA 0%, #2980B9 100%);
    --grad-danger: linear-gradient(135deg, #FF9A9E 0%, #FAD0C4 100%);

    /* Text Colors */
    --color-solar: #FF8C42;
    --color-consumer: #2980B9;
    --color-group: #3DBE8D;
    --color-energy: #F44336;
    --color-header: #764ba2;
    --color-admin: #667eea;
}

/* --- Global Styles --- */
html,
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* --- Gradient Utility Classes with Aesthetic Polish --- */
.gradient-header,
.gradient-solar,
.gradient-consumer,
.gradient-group,
.gradient-energy,
.gradient-admin,
.gradient-warning,
.gradient-success,
.gradient-info,
.gradient-danger {
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 6px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.gradient-header {
    background: var(--grad-header) !important;
}

.gradient-solar {
    background: var(--grad-solar) !important;
}

.gradient-consumer {
    background: var(--grad-consumer) !important;
}

.gradient-group {
    background: var(--grad-group) !important;
}

.gradient-energy {
    background: var(--grad-energy) !important;
}

.gradient-admin {
    background: var(--grad-admin) !important;
}

.gradient-warning {
    background: var(--grad-warning) !important;
}

.gradient-success {
    background: var(--grad-success) !important;
}

.gradient-info {
    background: var(--grad-info) !important;
}

.gradient-danger {
    background: var(--grad-danger) !important;
}

/* Force white content inside gradients */
.gradient-solar *,
.gradient-consumer *,
.gradient-group *,
.gradient-energy *,
.gradient-header *,
.gradient-admin *,
.gradient-warning *,
.gradient-success *,
.gradient-info *,
.gradient-danger * {
    color: white !important;
    fill: white !important;
}

/* --- Page Backgrounds (Subtle) --- */
.page-background-solar {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.04) 0%, rgba(255, 140, 66, 0.04) 100%);
    min-height: 100vh;
}

.page-background-consumer {
    background: linear-gradient(135deg, rgba(109, 213, 250, 0.04) 0%, rgba(41, 128, 185, 0.04) 100%);
    min-height: 100vh;
}

.page-background-group {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.04) 0%, rgba(61, 190, 141, 0.04) 100%);
    min-height: 100vh;
}

.page-background-energy {
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.04) 0%, rgba(250, 208, 196, 0.04) 100%);
    min-height: 100vh;
}

.page-background-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
    min-height: 100vh;
}

.page-background-admin {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04) 0%, rgba(118, 75, 162, 0.04) 100%);
    min-height: 100vh;
}

/* --- Icon Boxes --- */
.icon-box-positive {
    background-color: #E8F5E9;
    color: #4CAF50;
    border-radius: 50%;
    padding: 8px;
    display: inline-flex;
}

.icon-box-neutral {
    background-color: #E3F2FD;
    color: #2196F3;
    border-radius: 50%;
    padding: 8px;
    display: inline-flex;
}

.icon-box-critical {
    background-color: #FFEBEE;
    color: #F44336;
    border-radius: 50%;
    padding: 8px;
    display: inline-flex;
}

.icon-box-warning {
    background-color: #FFF3E0;
    color: #FF9800;
    border-radius: 50%;
    padding: 8px;
    display: inline-flex;
}

/* --- Hover Effects --- */
.hover-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

.grayscale {
    opacity: 0.7;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.grayscale:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-card {
    height: 150px;
}

.skeleton-table-row {
    height: 3rem;
    margin-bottom: 0.5rem;
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem !important;
    color: #bdbdbd;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #424242;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 1rem;
    color: #757575;
    margin-bottom: 2rem;
}

/* --- Responsive Tables --- */
@media (max-width: 960px) {
    .mud-table-container {
        overflow-x: auto;
    }
    
    .responsive-table {
        min-width: 600px;
    }
}

/* --- Action Buttons with Tooltips --- */
.action-button {
    margin: 0 4px;
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: scale(1.1);
}

/* --- Confirmation Dialog Styles --- */
.confirm-delete-dialog .mud-dialog-title {
    background: linear-gradient(135deg, #FF9A9E 0%, #FAD0C4 100%);
    color: white;
}

.confirm-action-dialog .mud-dialog-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* --- Status Badges --- */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-pending {
    background-color: #FFF3E0;
    color: #F57C00;
}

.status-approved {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.status-rejected {
    background-color: #FFEBEE;
    color: #C62828;
}

.status-active {
    background-color: #E3F2FD;
    color: #1565C0;
}

/* --- Progress Indicators --- */
.progress-wrapper {
    position: relative;
    padding: 1rem 0;
}

.progress-smooth {
    transition: all 0.3s ease;
}

/* --- Form Styles --- */
.form-field-wrapper,
.register-form-field {
    margin-bottom: 1.5rem;
}

.form-field-wrapper .mud-input-control,
.register-form-field .mud-input-control {
    margin-bottom: 0.5rem;
}

.validation-message {
    color: var(--mud-palette-error);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Autofill Reset */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
}

/* --- Page Headers --- */
.page-header {
    margin-bottom: 2rem;
}

.page-header-title {
    font-size: 2rem;
    font-weight: 600;
    color: #212121;
    margin-bottom: 0.5rem;
}

.page-header-description {
    font-size: 1rem;
    color: #757575;
}

/* --- Card Enhancements --- */
.stat-card {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* --- MudBlazor Overrides for Consistency --- */
.mud-paper {
    border-radius: 8px !important;
}

.mud-card {
    border-radius: 8px !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* --- Utility Classes --- */
.cursor-pointer {
    cursor: pointer;
}

.text-gradient-solar {
    background: var(--grad-solar);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-consumer {
    background: var(--grad-consumer);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-group {
    background: var(--grad-group);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-admin {
    background: var(--grad-admin);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- Mobile Responsive Adjustments --- */
@media (max-width: 600px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    .page-header-title {
        font-size: 1.5rem;
    }
    
    .hover-card:hover {
        transform: none;
    }
}

/* --- Login Page & Auth Layouts --- */
.auth-hero-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-center;
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    font-size: 3.5rem !important;
    color: var(--color-admin);
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
}

.auth-title {
    font-weight: 900 !important;
    letter-spacing: -1px !important;
    background: var(--grad-admin);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.75rem;
    margin-top: -8px;
}

.auth-badge {
    display: inline-block;
    background: var(--grad-admin);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Pulsing animation for logo */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 4px 16px rgba(102, 126, 234, 0.5));
    }
}

.custom-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Input field enhancements */
.mud-input-outlined .mud-input-root {
    border-radius: 8px !important;
}

/* Button hover effects for auth */
.auth-submit-button {
    font-weight: 700 !important;
    text-transform: none !important;
    font-size: 1rem !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

.auth-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

/* Custom input focus glow */
.mud-input-outlined:focus-within {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Fix autofill highlighting */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: inherit !important;
}

.mud-input-root input::selection {
    background: transparent;
}
