/* 
 * Premium Light-Theme Glassmorphism Styling System
 * Solar & Battery Savings Platform
 */

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.glass-panel-dark {
    background: linear-gradient(135deg, rgba(107, 56, 212, 0.9), rgba(33, 112, 228, 0.9));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Interactive Glass Cards */
.interactive-glass-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.3s ease;
}
.interactive-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(107, 56, 212, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}
.interactive-glass-card:hover {
    transform: scale(1.02) translateY(-4px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0px 16px 48px rgba(31, 38, 135, 0.15), 0 0 0 1px rgba(107, 56, 212, 0.2);
}
.interactive-glass-card:hover::before {
    opacity: 1;
}

/* Level 1 Shadow */
.shadow-level-1 {
    box-shadow: 0px 8px 32px rgba(31, 38, 135, 0.05);
}

/* Level 2 Shadow */
.shadow-level-2 {
    box-shadow: 0px 12px 40px rgba(31, 38, 135, 0.1);
}

/* Tab Content Visibility with Transitions */
.tab-content {
    display: none;
    animation: tabFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes growUp {
    from { height: 0; opacity: 0; }
    to { opacity: 1; }
}
.animate-bar {
    animation: growUp 1s ease-out forwards;
    transform-origin: bottom;
}

@keyframes bgShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes breathingOpacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-breathe {
    animation: breathingOpacity 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeInUp {
        from { opacity: 0; transform: translateY(30px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .stagger-enter {
        opacity: 0;
        transform: translateY(30px);
        animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    .delay-100 { animation-delay: 100ms; }
    .delay-200 { animation-delay: 200ms; }
    .delay-300 { animation-delay: 300ms; }
    .delay-400 { animation-delay: 400ms; }
    .delay-500 { animation-delay: 500ms; }
    .delay-600 { animation-delay: 600ms; }

    @keyframes pulseGlow {
        0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); transform: scale(1); }
        50% { transform: scale(1.02); }
        70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
        100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); transform: scale(1); }
    }
    .animate-pulse-glow {
        animation: pulseGlow 2s infinite;
    }
    
    @keyframes badgeFill {
        from { width: 0%; }
        to { width: 100%; }
    }
    .animate-badge-fill {
        animation: badgeFill 1s ease-out forwards;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stagger-enter { opacity: 1; transform: none; }
    .opacity-0 { opacity: 1; }
}

/* Monolith Background Gradient with Motion */
body {
    background: linear-gradient(135deg, #f8f9ff 0%, #eaf1ff 50%, #f8f9ff 100%);
    background-size: 200% 200%;
    animation: bgShift 15s ease infinite;
    background-attachment: fixed;
}

button:active {
    transform: scale(0.95);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(107, 56, 212, 0.15);
    border-radius: 4px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 56, 212, 0.3);
}

/* Table Input Styling */
.tbl-input {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(107, 56, 212, 0.15);
    border-radius: 6px;
    color: #0b1c30;
    padding: 2.5px 5px;
    outline: none;
    transition: all 0.2s ease;
    font-size: 11px;
    width: 100%;
}
.tbl-input:focus {
    border-color: #6b38d4;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(107, 56, 212, 0.15);
}

/* Modal Overlay Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 28, 48, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    padding: 28px;
    box-shadow: 0px 24px 64px rgba(31, 38, 135, 0.15);
    transform: translateY(24px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* PDF Generation View styles */
#pdf-report-template,
#pdf-report-template *,
#pdf-report-template *::before,
#pdf-report-template *::after {
    box-sizing: border-box !important;
}

#pdf-report-template {
    position: absolute;
    left: 0;
    top: 0;
    z-index: -9999;
    width: 816px; /* 8.5 inches * 96 DPI */
    background: #ffffff;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 8.5px;
}

.pdf-page {
    width: 816px;
    height: 1056px; /* 11 inches * 96 DPI */
    padding: 40px 38px 50px 38px; /* 1 cm left/right margins (38px) */
    box-sizing: border-box;
    position: relative;
    background: #ffffff;
    page-break-after: always;
}

.pdf-page:last-child {
    page-break-after: avoid !important;
}

/* Cover Page (Carátula) */
.pdf-cover-page {
    padding: 60px 38px 60px 38px; /* 1 cm margins */
    border-left: 12px solid #6b38d4;
    height: 1056px;
    box-sizing: border-box;
    position: relative;
}

.pdf-cover-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
    height: 60px;
}

.pdf-cover-logo {
    width: 74px; /* 10% of content width (740px) */
    height: auto;
    float: left;
}

.pdf-cover-body {
    margin-top: 60px;
}

.pdf-cover-tagline {
    font-size: 11px;
    color: #6b38d4;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.pdf-cover-title {
    font-size: 24px;
    font-weight: 800;
    color: #0b1c30;
    line-height: 1.25;
    margin-bottom: 15px;
}

.pdf-cover-subtitle {
    font-size: 11px;
    color: #494454;
    line-height: 1.4;
    margin-bottom: 30px;
    max-width: 600px;
}

.pdf-cover-client-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

.pdf-cover-client-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.pdf-cover-client-table {
    width: 100%;
    border-collapse: collapse;
}

.pdf-cover-client-cell {
    padding: 6px 10px;
    vertical-align: top;
    width: 50%;
}

.pdf-cover-client-label {
    font-weight: 600;
    color: #64748b;
    font-size: 8px;
    text-transform: uppercase;
    display: block;
}

.pdf-cover-client-value {
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
    font-size: 10px;
    display: block;
}

.pdf-cover-footer {
    position: absolute;
    bottom: 50px;
    left: 38px; /* 1 cm margin */
    right: 38px; /* 1 cm margin */
    border-top: 1.5px solid #e2e8f0;
    padding-top: 20px;
    font-size: 9px;
    color: #64748b;
    height: 60px;
}

.pdf-cover-prepared {
    float: left;
    width: 50%;
}

.pdf-cover-meta {
    float: right;
    width: 50%;
    text-align: right;
}

/* Inner Page Header & Footer */
.pdf-page-header {
    height: 30px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    box-sizing: border-box;
    padding-bottom: 6px;
}

.pdf-page-header-logo {
    width: 45px; /* small logo (approx 10% header style) */
    height: auto;
    float: left;
    margin-top: 2px;
}

.pdf-page-header-client {
    font-size: 8.5px;
    color: #475569;
    font-weight: 500;
    float: right;
    line-height: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 450px;
    display: inline-block;
}

.pdf-page-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #6b38d4;
    padding-bottom: 4px;
    display: inline-block;
}

.pdf-page-footer {
    position: absolute;
    bottom: 25px;
    left: 38px; /* 1 cm margin */
    right: 38px; /* 1 cm margin */
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
    font-size: 8px;
    color: #64748b;
    box-sizing: border-box;
    height: 30px;
}

.pdf-page-footer-right {
    float: right;
}

.pdf-page-body {
    height: 900px;
    box-sizing: border-box;
    position: relative;
}

.pdf-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: #0b1c30;
    border-bottom: 2px solid #eff4ff;
    padding-bottom: 4px;
    margin-top: 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Card Layout (replacing CSS grid) */
.pdf-cards-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.pdf-cards-table td {
    width: 33.3%;
    padding: 0 8px;
    border: none !important;
}

.pdf-cards-table td:first-child {
    padding-left: 0;
}

.pdf-cards-table td:last-child {
    padding-right: 0;
}

.pdf-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 12px;
    box-sizing: border-box;
    text-align: center;
}

.pdf-card-label {
    font-size: 7.5px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.pdf-card-value {
    font-size: 11px;
    font-weight: 700;
    color: #0b1c30;
    margin-top: 3px;
    display: block;
}

/* Key Value specs (Table-based layout) */
.pdf-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 8px;
}

.pdf-specs-table-title {
    background: #eff4ff;
    color: #1e3a8a;
    font-weight: 700;
    padding: 5px 10px;
    text-transform: uppercase;
    font-size: 8px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}
    font-size: 9px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.pdf-specs-table td {
    padding: 6px 12px;
    width: 50%;
    border: none !important;
    border-bottom: 1px dashed #e2e8f0 !important;
}

.pdf-specs-table tr:last-child td {
    border-bottom: none !important;
}

.pdf-spec-label {
    color: #475569;
}

.pdf-spec-value {
    font-weight: 700;
    color: #0f172a;
    float: right;
}

/* PDF report table formatting styles (matching web) */
#pdf-report-template table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8.5px !important;
    margin-top: 5px !important;
}

#pdf-report-template table th,
#pdf-report-template table td {
    padding: 4px 6px !important;
    border: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
    font-size: 8.5px !important;
}

#pdf-report-template table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 7.5px !important;
    text-align: center !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

#pdf-report-template table td {
    color: #1e293b;
    text-align: right !important;
}

#pdf-report-template table td:first-child,
#pdf-report-template table th:first-child {
    text-align: left !important;
}

#pdf-table-hourly,
#pdf-table-annual-proj {
    font-size: 6.8px !important;
}

#pdf-table-hourly th, #pdf-table-hourly td,
#pdf-table-annual-proj th, #pdf-table-annual-proj td {
    padding: 2.2px 3.5px !important;
    font-size: 6.8px !important;
}

#pdf-table-hourly th {
    font-size: 6.2px !important;
}

/* Charts Containers */
.pdf-chart-container {
    height: 280px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
}

.pdf-chart-title {
    font-size: 8.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-chart-img {
    max-width: 100%;
    max-height: 220px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}


/* CFE Bill PDF Template & Styling */
#cfe-bills-container {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 790px;
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'Inter', Arial, sans-serif;
}

.cfe-bill-page {
    width: 100%;
    padding: 30px;
    background: #ffffff;
    box-sizing: border-box;
    page-break-after: always;
}

.cfe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #008224;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

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

.cfe-logo-green {
    font-weight: 800;
    font-size: 26px;
    color: #008224;
    letter-spacing: -1px;
    font-family: 'Outfit', sans-serif;
}

.cfe-logo-sub {
    font-size: 10px;
    font-weight: 600;
    color: #4a4a4a;
    line-height: 1.2;
    text-transform: uppercase;
}

.cfe-bill-title {
    text-align: right;
    font-size: 14px;
    color: #008224;
    font-weight: 700;
    text-transform: uppercase;
}

.cfe-client-info {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 11px;
    line-height: 1.4;
}

.cfe-client-details {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    background: #f8fafc;
}

.cfe-client-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.cfe-payment-summary {
    border: 2px solid #008224;
    border-radius: 6px;
    background: #f4faf5;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cfe-total-pay {
    font-size: 22px;
    font-weight: 800;
    color: #008224;
    text-align: center;
    margin: 8px 0;
    font-family: 'Outfit', sans-serif;
}

.cfe-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 12px;
    font-size: 10px;
    border: 1px solid #e2e8f0;
}

.cfe-info-item {
    display: flex;
    flex-direction: column;
}

.cfe-info-label {
    color: #64748b;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-size: 9px;
}

.cfe-info-value {
    font-weight: 700;
    color: #0f172a;
}

.cfe-table-section {
    margin-bottom: 15px;
}

.cfe-table-title {
    background: #008224;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 4px 4px 0 0;
    text-transform: uppercase;
}

.cfe-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    border: 1px solid #e2e8f0;
}

.cfe-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    text-align: right;
}

.cfe-table th:first-child, .cfe-table td:first-child {
    text-align: left;
}

.cfe-table td {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    text-align: right;
    color: #334155;
}

.cfe-billing-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.cfe-charges-table td {
    padding: 4px 8px;
}

.cfe-charges-total {
    font-weight: 700;
    background: #f4faf5;
    color: #008224 !important;
}

.cfe-barcode-area {
    border-top: 1px dashed #cbd5e1;
    padding-top: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cfe-barcode-lines {
    height: 35px;
    width: 250px;
    background: repeating-linear-gradient(90deg, #1e293b 0px, #1e293b 2px, #fff 2px, #fff 4px, #1e293b 4px, #1e293b 5px, #fff 5px, #fff 8px);
}

.cfe-footer-note {
    font-size: 9px;
    color: #64748b;
    text-align: right;
    line-height: 1.3;
}


/* ==========================================================================
   PREMIUM LANDSCAPE PDF REPORT STYLING
   ========================================================================== */
#pdf-premium-template {
    display: none;
    background: #f3f2ee;
}

#pdf-premium-template * {
    box-sizing: border-box !important;
}

.pdf-premium-page {
    position: relative;
    width: 1280.16pt;
    height: 720pt;
    background-color: #f3f2ee;
    overflow: hidden;
    page-break-after: always;
}

.pdf-premium-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    object-fit: cover;
}

.pdf-premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Custom styling for tables nested inside the landscape slides */
#pdf-premium-template table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8px !important;
    font-family: 'Outfit', 'Inter', sans-serif !important;
}

#pdf-premium-template table th,
#pdf-premium-template table td {
    padding: 3px 5px !important;
    border: 1px solid #e2e8f0 !important;
    box-sizing: border-box !important;
    font-size: 8px !important;
}

#pdf-premium-template table th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 7.5px !important;
    text-align: center !important;
}

#pdf-premium-template table td {
    color: #334155 !important;
    text-align: right !important;
}

#pdf-premium-template table td:first-child,
#pdf-premium-template table th:first-child {
    text-align: left !important;
}

/* Super compact styling for the hourly breakdown table to fit on page 9 */
#pdf-premium-table-hourly {
    font-size: 6.8px !important;
}

#pdf-premium-table-hourly th, #pdf-premium-table-hourly td {
    padding: 2px 3px !important;
    font-size: 6.8px !important;
}

#pdf-premium-table-hourly th {
    font-size: 6px !important;
}

/* Super compact styling for the annual table to fit on page 10 */
#pdf-premium-table-annual-savings {
    font-size: 8px !important;
}

#pdf-premium-table-annual-savings th, #pdf-premium-table-annual-savings td {
    padding: 3.5px 5px !important;
}
