* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Alphabet Sans Office TT, sans-serif; 
    background: #f5f7fa;
    line-height: 1.6;
}
.header {
    background-image: url('Banner.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    aspect-ratio: 16 / 5;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Menu Navigation Bar */
.menu-nav {
    background: linear-gradient(135deg, #6eb4f5 0%, #4362ab 100%);
    padding: 15px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.menu-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
}
.menu-nav button {
    padding: 12px 30px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}
.menu-nav button:hover {
    background-color: white;
    color: #6eb4f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}
.menu-nav button.active {
    background-color: white;
    color: #6eb4f5;
    font-weight: 700;
}

/* Slider Styles */
.slidecontainer {
    width: 100%;
    max-width: 1200px;
    height: 120px;
    margin: 5px auto;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f0 100%);
    border-radius: 12px;
    border: 2px solid #17a2b8;
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.2);
}

.slider-label {
    text-align: center;
    color: #0c5460;
    font-size: 0.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}
.slider-value {
    text-align: center;
    color: #0c5460;
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 4px;
}
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    background: rgba(23, 162, 184, 0.25);
    outline: none;
    opacity: 1;
    -webkit-transition: .2s;
    transition: opacity .2s;
    border-radius: 12px;
}
.slider:hover {
    opacity: 1;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 25px;
    border: 2px solid #17a2b8;
    background: url('mini.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.main { max-width: 1400px; margin: 0 auto; padding: 40px 20px; }
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}
.card h2 {
    color: #1a1a2e;
    margin-bottom: 20px;
    border-bottom: 3px solid #16213e;
    padding-bottom: 10px;
    font-size: 1.8rem;
}
.card h3 {
    color: #1a1a2e;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4rem;
}
button {
    padding: 12px 28px;
    background-color: #16213e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 10px 10px 0;
}
button:hover:not(:disabled) {
    background-color: #0f3460;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 33, 62, 0.3);
}
button:disabled { background-color: #ccc; cursor: not-allowed; transform: none; }

select {
    padding: 10px 15px;
    border-radius: 6px;
    border: 2px solid #16213e;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background-color: white;
    color: #16213e;
    transition: all 0.3s ease;
    margin-right: 10px;
}
select:hover {
    border-color: #0f3460;
    box-shadow: 0 2px 8px rgba(22, 33, 62, 0.2);
}
select:focus {
    outline: none;
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(22, 33, 62, 0.1);
}

/* File Upload Grid */
.file-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.file-upload-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.file-upload-item:hover {
    border-color: #16213e;
    box-shadow: 0 2px 8px rgba(22, 33, 62, 0.1);
}

.file-upload-item.uploaded {
    border-color: #2ecc71;
    background: #e8f8f0;
}

.file-upload-label {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.file-upload-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

input[type="file"] {
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    font-size: 0.9rem;
    background: white;
}

input[type="number"] {
    padding: 10px;
    border: 2px solid #16213e;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
}

.file-status {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 4px;
}

.file-status.success {
    background: #d4edda;
    color: #155724;
}

.file-status.pending {
    background: #fff3cd;
    color: #856404;
}

.status {
    font-weight: bold;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    white-space: pre-wrap;
}
.status.success { background: #d4edda; color: #155724; }
.status.error { background: #f8d7da; color: #721c24; }
.status.info { background: #d1ecf1; color: #0c5460; }
.status.warning { background: #fff3cd; color: #856404; }
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #16213e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Validation Results */
.validation-results {
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
}
.validation-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.validation-item.valid {
    background: #d4edda;
    border-left-color: #2ecc71;
    color: #155724;
}
.validation-item.invalid {
    background: #f8d7da;
    border-left-color: #e74c3c;
    color: #721c24;
}
.validation-icon {
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}
.validation-content {
    flex: 1;
}
.validation-label {
    font-weight: bold;
    margin-bottom: 3px;
}
.validation-message {
    font-size: 0.9rem;
}

/* Monthly Results Box */
.monthly-results-box {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f0 100%);
    border-radius: 12px;
    border: 2px solid #17a2b8;
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.2);
}
.monthly-results-box h3 {
    margin-top: 0;
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 10px;
}
.monthly-results-box p {
    margin-bottom: 15px;
    color: #0c5460;
}
.monthly-results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.monthly-results-tip {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

/* Tolerance Info Box */
.tolerance-info-box {
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f0 100%);
    border: 2px solid #17a2b8;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
}
.tolerance-info-box h3 {
    color: #0c5460;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tolerance-info-content {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 6px;
    font-size: 1rem;
    color: #0c5460;
    line-height: 1.6;
}
.tolerance-info-content p {
    margin-bottom: 10px;
}
.tolerance-info-content p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-style: italic;
}

/* Month Section */
.month-section {
    border-left: 4px solid #16213e;
    padding-left: 25px;
    margin: 30px 0;
    background: #fafafa;
    padding: 20px 20px 20px 25px;
    border-radius: 8px;
}
.month-section.no-data {
    border-left-color: #f39c12;
    background: #fff8e1;
}
.month-header {
    font-size: 1.5rem;
    color: #1a1a2e;
    margin-bottom: 15px;
    font-weight: bold;
}
.month-info {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}
.no-data-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #f39c12;
    margin: 10px 0;
}

/* Combination Card */
.combination {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 5px solid #0f3460;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.combination-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}
.combination-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #16213e;
}
.combination-score {
    background: linear-gradient(135deg, #6eb4f5 0%, #4362ab 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}
.combination-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.summary-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #16213e;
}
.summary-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.summary-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a2e;
}

/* Technology Details */
.tech-gear-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #16213e;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.tech-card {
    position: relative;
}
.tech-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.tech-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}
.tech-card.biw { border-left: 5px solid #1e3a8a; }
.tech-card.pnt { border-left: 5px solid #3b82f6; }
.tech-card.ass { border-left: 5px solid #a3ccff; }

.tech-card.biw .tech-gear-badge { background: #1e3a8a; }
.tech-card.pnt .tech-gear-badge { background: #3b82f6; }
.tech-card.ass .tech-gear-badge { background: #60a5fa; }

.tech-header {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}
.tech-card.biw .tech-header { color: #1e3a8a; }
.tech-card.pnt .tech-header { color: #3b82f6; }
.tech-card.ass .tech-header { color: #a3ccff; }
.tech-info {
    font-size: 0.9rem;
    line-height: 1.8;
}
.tech-info div {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.tech-info strong {
    color: #333;
}
.tech-info span {
    color: #555;
    font-weight: 600;
}
.measures {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.2);
    font-size: 0.85rem;
    color: #666;
}

/* Progress indicator */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6eb4f5 0%, #4362ab 100%);
    animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #6eb4f5 0%, #4362ab 100%);
    border-radius: 8px;
    color: white;
}
.stat-box {
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 2s ease;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#splash-screen img {
    max-width: 1100px;
    height: auto;
}

/* n8n Chat Widget */
n8n-chat-launcher {
    --n8n-chat-launcher-bg: #4362ab; 
    --n8n-chat-launcher-bg-hover: #304a85; 
    --n8n-chat-launcher-icon-color: #ffffff;
    --n8n-chat-launcher-size: 68px;
    --n8n-chat-launcher-border-radius: 50%;
    --n8n-chat-launcher-shadow: 0 6px 20px rgba(0,0,0,0.25);
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

n8n-chat-launcher:hover {
    --n8n-chat-launcher-bg: #304a85;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

n8n-chat {
    --n8n-chat-width: 380px;
    --n8n-chat-height: 580px;
    --n8n-chat-border-radius: 20px;
    --n8n-chat-shadow: 0 12px 32px rgba(0,0,0,0.25);
    --n8n-chat-bg: #ffffff;
    --n8n-chat-font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    position: fixed;
    bottom: 110px;
    right: 30px;
    z-index: 1100;
    box-shadow: var(--n8n-chat-shadow);
    border-radius: var(--n8n-chat-border-radius);
    overflow: hidden;
}

n8n-chat::part(header) {
    background: linear-gradient(135deg, #6eb4f5, #4362ab);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 18px 24px;
    border-top-left-radius: var(--n8n-chat-border-radius);
    border-top-right-radius: var(--n8n-chat-border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    user-select: none;
}

n8n-chat::part(message-bot) {
    background: #f1f4ff;
    border-radius: 14px 14px 4px 14px;
    color: #1a1a2e;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 10px 14px;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(67, 98, 171, 0.15);
}

n8n-chat::part(message-user) {
    background: #dce9ff;
    border-radius: 14px 14px 14px 4px;
    color: #0d204b;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 14px;
    max-width: 80%;
    box-shadow: 0 1px 3px rgba(67, 98, 171, 0.25);
}

n8n-chat::part(input) {
    border: 2px solid #4362ab;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 1rem;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: inset 0 2px 6px rgba(67, 98, 171, 0.15);
    transition: border-color 0.3s ease;
}

n8n-chat::part(input):focus {
    outline: none;
    border-color: #304a85;
    box-shadow: 0 0 8px rgba(48, 74, 133, 0.6);
}

n8n-chat::part(send-button) {
    background: #4362ab;
    color: white;
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(67, 98, 171, 0.3);
}

n8n-chat::part(send-button):hover {
    background: #304a85;
    box-shadow: 0 6px 14px rgba(48, 74, 133, 0.5);
}

n8n-chat::-webkit-scrollbar {
    width: 8px;
}

n8n-chat::-webkit-scrollbar-track {
    background: #e5e9f2;
    border-radius: 8px;
}

n8n-chat::-webkit-scrollbar-thumb {
    background: #4362ab;
    border-radius: 8px;
    border: 2px solid #e5e9f2;
}

@media (max-width: 480px) {
    n8n-chat {
        --n8n-chat-width: 320px;
        --n8n-chat-height: 500px;
        bottom: 90px;
        right: 15px;
    }

    n8n-chat-launcher {
        --n8n-chat-launcher-size: 56px;
        bottom: 20px;
        right: 15px;
    }
}

/* File Upload Button Styles */
.file-upload-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    z-index: 1099;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.file-upload-button {
    background: linear-gradient(135deg, #6eb4f5, #4362ab);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(67, 98, 171, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-upload-button:hover {
    background: linear-gradient(135deg, #5a9de0, #304a85);
    box-shadow: 0 6px 16px rgba(67, 98, 171, 0.4);
    transform: translateY(-2px);
}

.file-upload-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.file-upload-status {
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 13px;
    max-width: 300px;
    display: none;
}

.file-upload-status.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.file-upload-status.success {
    border-left: 4px solid #2ecc71;
    color: #155724;
}

.file-upload-status.error {
    border-left: 4px solid #e74c3c;
    color: #721c24;
}

.file-upload-status.uploading {
    border-left: 4px solid #3498db;
    color: #004085;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-icon {
    font-size: 18px;
}

/* What-If Notification */
.what-if-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #0a6ed1; 
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 400px;
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.what-if-notification-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.what-if-notification-content {
    font-size: 14px;
    margin-bottom: 15px;
    opacity: 0.95;
}

.what-if-notification-actions {
    display: flex;
    gap: 10px;
}

.what-if-notification button {
    margin: 0;
}

/* Primary action */
.what-if-notification .btn-apply {
    background: #ffffff;
    color: #0a6ed1;
    font-weight: 600;
    border-radius: 6px;
}

/* Secondary action */
.what-if-notification .btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 480px) {
    .what-if-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}