/* ==================================================
   B2B Local Sourcing Calculator - Stylesheet
   Sofia 2027 - Sustainable Green Neon Aesthetic
   ================================================== */

:root {
    --font-header: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme Colors */
    --bg-main: #040812;
    --bg-card: rgba(13, 27, 42, 0.55);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(16, 185, 129, 0.4);
    
    /* Neon Sustainability Colors */
    --color-primary: #10b981;    /* Emerald Green */
    --color-secondary: #06b6d4;  /* Cyan */
    --color-warning: #f59e0b;    /* Amber */
    --color-danger: #ef4444;     /* Red */
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow blobs */
.glow-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 25%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 85%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
    filter: blur(80px);
    pointer-events: none;
}

/* Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.badge {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #040812;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

h1 {
    font-family: var(--font-header);
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Language selector */
.lang-selector {
    display: flex;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 0.2rem;
}

.lang-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    border-radius: 5px;
    transition: var(--transition-smooth);
}

.lang-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Layout Split Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.inputs-panel, .results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glassmorphism Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(16, 185, 129, 0.12);
}

.glass {
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    pointer-events: none;
}

.card-title {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.25rem;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-input {
    background: rgba(10, 15, 30, 0.8);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.profile-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

/* Table styling for expenses input */
.table-container {
    overflow-x: auto;
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.expenses-table th {
    font-family: var(--font-header);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-card);
    padding: 0.5rem 0.75rem;
}

.expenses-table td {
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.table-input {
    width: 100%;
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: var(--transition-smooth);
}

.table-input:focus {
    border-color: var(--color-primary);
    background: rgba(10, 15, 30, 0.8);
}

.table-input-cat {
    font-weight: 600;
    color: #ffffff;
}

.btn-delete-row {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-danger);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.btn-delete-row:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Progress gauge styling */
.gauge-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.circular-progress {
    position: relative;
    height: 160px;
    width: 160px;
    border-radius: 50%;
    background: conic-gradient(rgba(255, 255, 255, 0.05) 360deg, transparent 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.circular-progress::before {
    content: "";
    position: absolute;
    height: 130px;
    width: 130px;
    border-radius: 50%;
    background-color: #0b1528;
}

.progress-value {
    position: relative;
    font-family: var(--font-header);
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

/* Sourcing Totals list */
.sourcing-totals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.val-local {
    color: var(--color-primary);
    font-weight: 700;
    font-family: var(--font-header);
}

.val-import {
    color: var(--color-warning);
    font-weight: 700;
    font-family: var(--font-header);
}

/* Compliance status badges */
.compliance-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
}

.compliance-badge {
    padding: 0.5rem 2rem;
    border-radius: 9999px;
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.compliance-badge.compliant {
    background: linear-gradient(135deg, var(--color-primary), #059669);
    color: #040812;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.25);
}

.compliance-badge.non-compliant {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #040812;
    box-shadow: none;
}

.compliance-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Recommendations list */
.recommendation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-list li {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.01);
    border-left: 3px solid var(--color-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.recommendation-list li.warning {
    border-left-color: var(--color-warning);
}

.recommendation-list li strong {
    color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    outline: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #059669);
    color: #040812;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-primary:disabled {
    background: #1e293b !important;
    color: #475569 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    width: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Modal overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    position: relative;
    max-width: 600px;
    width: 100%;
    animation: modalShow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalShow {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    z-index: 10;
}

.close-modal:hover {
    color: #ffffff;
}

/* Certificate Canvas Container */
.certificate-canvas {
    background: radial-gradient(circle, #102a43 0%, #0c1c2e 100%);
    padding: 2.25rem;
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.cert-border {
    border: 2px solid #b79457; /* Gold border outline */
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
}

.cert-seal {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.cert-header h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 800;
    color: #b79457;
    letter-spacing: 0.1em;
}

.cert-header p {
    font-family: var(--font-header);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.cert-body {
    margin: 2rem 0;
}

.cert-presented {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.cert-business-name {
    font-family: var(--font-header);
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0.5rem 0;
    border-bottom: 1px solid rgba(183, 148, 87, 0.25);
    display: inline-block;
    padding-bottom: 0.25rem;
}

.cert-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 400px;
    margin: 0.75rem auto 1.5rem;
}

.cert-stats {
    display: inline-block;
    border: 1px solid #b79457;
    background: rgba(183, 148, 87, 0.05);
    padding: 0.5rem 2rem;
    border-radius: 4px;
}

.stat-label {
    display: block;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: #b79457;
    font-weight: 700;
}

.stat-num {
    display: block;
    font-family: var(--font-header);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-top: 0.1rem;
}

.cert-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
}

.signature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
}

.sig-line {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 0.35rem;
}

.sig-title {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.modal-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
}

/* Printable Certificate Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #cert-modal, #cert-modal *, .certificate-canvas, .certificate-canvas * {
        visibility: visible;
    }
    #cert-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: none;
        backdrop-filter: none;
        display: flex;
        padding: 0;
    }
    .close-modal, .modal-actions {
        display: none !important;
    }
    .certificate-canvas {
        background: #ffffff !important;
        color: #000000 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    .cert-border {
        border-color: #000000 !important;
    }
    .cert-header h3 {
        color: #000000 !important;
    }
    .cert-business-name {
        color: #000000 !important;
        border-bottom-color: #000000 !important;
    }
    .cert-stats {
        border-color: #000000 !important;
        background: none !important;
    }
    .stat-label {
        color: #000000 !important;
    }
    .stat-num {
        color: #000000 !important;
    }
    .sig-line {
        background: #000000 !important;
    }
}

/* Footer & Disclaimers */
.app-footer {
    border-top: 1px solid var(--border-card);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: transparent;
    box-shadow: none;
}

.disclaimer-content {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    max-width: 800px;
}

.copyright {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.15);
    text-align: center;
    margin-top: 0.5rem;
}

/* Mobile and Tablet Responsiveness Updates */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .badge {
        font-size: 0.7rem;
    }
    
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .expenses-table th, .expenses-table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .table-input {
        padding: 0.4rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .btn {
        width: 100%;
    }
}

/* Suite Navigation Bar */
.suite-nav {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 0.75rem;
}

.suite-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.suite-nav-link:hover {
    color: #ffffff;
}

.suite-nav-link.active {
    color: var(--color-primary);
}


