﻿/* ==========================================
   DisplayCase Configurator (Snêk Design Style)
   ========================================== */

/* Layout container */
.sprojskonfigurator-wrapper {
    display: flex;
    flex-direction: row;
    gap: var(--space-2xl);
    background-color: var(--color-light-gray);
    padding: var(--space-md);
    border-radius: var(--radius-null);
}

/* Left control panel */
.sprojskonfigurator-controls {
    flex: 0 0 300px;
    background-color: var(--color-surface);
    border-radius: var(--radius-null);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}


/* Buttons */
.btn-snek {
    background-color: var(--color-accent-primary);
    color: var(--color-surface);
    border: none;
    border-radius: var(--radius-null);
    padding: var(--space-sm) var(--space-lg);
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-snek:hover {
        background-color: var(--color-hortensia);
        transform: translateY(-2px);
    }


/* Right preview area */
.sprojskonfigurator-preview {
    flex: 1;
    background-color: var(--color-surface);
    border-radius: var(--radius-null);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.preview-wrap {
    background-color: var(--color-light-gray);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-null);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    overflow: auto;
}

/* Box list */
.box-table {
    margin-top: var(--space-lg);
    border-radius: var(--radius-null);
    overflow: hidden;
}

    .box-table table {
        width: 100%;
        border-collapse: collapse;
    }

    .box-table th, .box-table td {
        padding: var(--space-sm);
        text-align: center;
    }

    .box-table th {
        background-color: var(--color-light-gray);
        font-weight: 600;
        color: var(--color-text);
    }

    .box-table td span.badge {
        border-radius: var(--radius-null);
        padding: 2px 8px;
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .sprojskonfigurator-wrapper {
        flex-direction: column;
        padding: var(--space-lg);
    }

    .sprojskonfigurator-controls {
        flex: none;
        width: 100%;
    }
}
/*
=======================
Responsive Modal Layout
======================= */

.config-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(58, 53, 49, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    padding: var(--space-md);
}

.config-modal-content {
    background-color: var(--color-surface);
    border-radius: var(--radius-null);
    box-shadow: var(--shadow-lg);
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.config-modal-header {
    background: linear-gradient(135deg, var(--color-accent-primary), var(--color-hortensia));
    color: var(--color-surface);
    padding: var(--space-lg) var(--space-xl) var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.config-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
    background-color: var(--color-light-gray);
}

.config-modal-close {
    background: none;
    border: none;
    color: var(--color-surface);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

    .config-modal-close:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

/* Make modal fullscreen on smaller screens */
@media (max-width: 1024px) {
    .config-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }

    .config-modal-header,
    .config-modal-body {
        padding: var(--space-lg);
    }
}

/* --- Toast notification (pure Blazor version) --- */
.snek-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #198754; /* Bootstrap success color */
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

    /* When active (shown) */
    .snek-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

/* Toast inner layout */
.snek-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.snek-toast-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: opacity 0.2s ease;
}

    .snek-toast-close:hover {
        opacity: 0.7;
    }

/* --- Success Modal Overlay --- */
.success-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(58, 53, 49, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

/* --- Success Modal Content --- */
.success-modal {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 400px;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.success-modal .success-modal-header{
    padding: 1rem 1.5rem;
    background-color: #198754; /* Bootstrap success green */
}

.success-modal .success-modal-body {
    padding: 1.5rem;
    color: #333;
}

.success-modal button {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
}



/*Buttons*/

/* Base button */
.btn-configurator {
    display: inline-block;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #333;
}

    .btn-configurator:hover {
        background: #e9ecef;
    }

/* Small compact buttons */
.btn-xs {
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    min-width: 32px;
    min-height: 28px;
}

/* Variants */
.btn-secondary {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #333;
}

    .btn-secondary:hover {
        background: #ddd;
    }

.btn-danger {
    background: #dc3545;
    border-color: #b02a37;
    color: #fff;
}

    .btn-danger:hover {
        background: #bb2d3b;
    }

/* Utility helpers */
.w-100 {
    width: 100%;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.gap-1 > * + * {
    margin-top: 4px;
}

/*Form Select Styling*/
.pattern-form {
    max-width: 400px; /* Limit width */
    margin: 0 auto; /* Center it */
    padding: 1rem;
    background-color: #f9f9f9; /* Light background */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
}

.form-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group select {
    /* If needed, override */
}
.preview-wrap {
    display: flex;
    justify-content: center;   /* Keeps SVG in the middle */
    align-items: center;       /* Vertically aligned */
    gap: 1rem;                 /* space between elements */
}

/* Lock control panels */
.preview-wrap .line-controls {
    flex: 0 0 200px;           /* fixed width, adjust as needed */
}

/* Lock preview area */
.preview-wrap .svg-container {
    flex: 0 0 auto;            /* takes only as much space as the SVG */
}
