:root {
    --legrand-red: #e30613;
    --legrand-dark: #1d1d1b;
    --legrand-gray: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: #f9fafb;
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background-color: white;
    border-bottom: 2px solid var(--legrand-red);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.app-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo .legrand-logo-img {
    width: 190px;
    height: auto;
    display: block;
}

h1 {
    font-size: 1.2rem;
    color: var(--legrand-dark);
    font-weight: 500;
}

.print-header {
    display: none;
}

/* Search Section */
.search-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--legrand-dark);
}

input[type="text"] {
    width: 100%;
    height: 50px;
    /* One large horizontal input */
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1.1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--legrand-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.1);
}

.hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--legrand-red);
    color: white;
}

.btn-primary:hover {
    background-color: #c00510;
}

.btn-secondary {
    background-color: #eee;
    color: #333;
}

.btn-secondary:hover {
    background-color: #ddd;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--legrand-dark);
    color: var(--legrand-dark);
}

/* Results */
.hidden {
    display: none !important;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.empty-state {
    text-align: center;
    color: #888;
    padding: 3rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-header {
    background-color: var(--legrand-dark);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-title h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.product-codes {
    font-size: 0.9rem;
    opacity: 0.8;
}

.packaging-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background-color: #eee;
    /* for gap borders */
}

.level-card {
    background-color: white;
    padding: 1.5rem;
}

.level-title {
    color: var(--legrand-red);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.label {
    color: #666;
}

.value {
    font-weight: 500;
}

/* Print Styles */
@media print {

    .app-header,
    .search-section,
    .app-footer,
    .actions,
    #clear-btn,
    #export-actions {
        display: none;
    }

    body {
        background-color: white;
    }

    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--legrand-red);
        color: var(--legrand-dark);
        font-size: 0.9rem;
        font-weight: 500;
    }

    .print-logo-img {
        width: 165px;
        height: auto;
        display: block;
    }

    .print-header p {
        text-align: right;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .product-card {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .level-card {
        border: 1px solid #eee;
    }
}

/* Spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--legrand-red);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading {
    text-align: center;
    padding: 2rem;
}

#export-actions {
    text-align: right;
    margin-bottom: 2rem;
}
