/* ============================================
   LOVARE KONWERTER - STYLES
   Elegancki, minimalistyczny design
   ============================================ */

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

:root {
    --lovare-primary: #C4877A;
    --lovare-primary-light: #4A3835;
    --lovare-primary-dark: #D69D8F;
    --lovare-bg: #1C1514;
    --lovare-text: #E0D0CB;
    --lovare-text-light: #9A8A84;
    --lovare-white: #2A2120;
    --lovare-success: #5E9462;
    --lovare-error: #C47070;
    --lovare-shadow: rgba(0, 0, 0, 0.35);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--lovare-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--lovare-text);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
}

.lang-btn {
    padding: 6px 12px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 6px;
    background: transparent;
    color: var(--lovare-text-light);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    border-color: var(--lovare-primary);
    color: var(--lovare-text);
}

.lang-btn.active {
    background: var(--lovare-primary);
    border-color: var(--lovare-primary);
    color: white;
}

/* Container */
.container {
    background: var(--lovare-white);
    border-radius: 24px;
    box-shadow: 0 8px 40px var(--lovare-shadow);
    padding: 28px 36px;
    width: min(1140px, 100%);
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo-subtitle {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--lovare-text-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* API Section */
.api-section {
    margin-bottom: 24px;
}

.api-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--lovare-text);
    margin-bottom: 8px;
}

.api-section input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--lovare-text);
    background: var(--lovare-bg);
    transition: all 0.3s ease;
}

.api-section input[type="password"]:focus {
    outline: none;
    border-color: var(--lovare-primary);
    background: var(--lovare-white);
}

.api-section input[type="password"]::placeholder {
    color: var(--lovare-text-light);
}

.api-section small {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--lovare-text-light);
}

/* Options Row */
.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 16px;
}

.option-group {
    min-width: 0;
}

.option-group--full {
    grid-column: 1 / -1;
}

.option-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--lovare-text);
    margin-bottom: 4px;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
}

.custom-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--lovare-text);
    background: var(--lovare-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.custom-select__trigger:hover {
    border-color: var(--lovare-primary);
}

.custom-select.open .custom-select__trigger {
    border-color: var(--lovare-primary);
    background: var(--lovare-white);
    border-radius: 10px 10px 0 0;
}

.custom-select__arrow {
    color: var(--lovare-text-light);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.custom-select.open .custom-select__arrow {
    transform: rotate(180deg);
}

.custom-select__options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--lovare-white);
    border: 2px solid var(--lovare-primary);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px var(--lovare-shadow);
}

.custom-select.open .custom-select__options {
    display: block;
}

.custom-select__option {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--lovare-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.custom-select__option:hover {
    background: var(--lovare-bg);
}

.custom-select__option--selected {
    background: var(--lovare-primary-light);
    color: var(--lovare-text);
    font-weight: 500;
}

.custom-select__option--selected:hover {
    background: var(--lovare-primary-light);
}

/* Disabled state */
.custom-select--disabled {
    pointer-events: none;
    opacity: 0.35;
}

.option-group--disabled label {
    opacity: 0.35;
}

.drop-zone--disabled {
    pointer-events: none;
    opacity: 0.3;
}

/* Client Search Dropdown */
.client-search {
    position: relative;
    width: 100%;
}

.client-search--disabled {
    pointer-events: none;
    opacity: 0.35;
}

.client-search__input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--lovare-text);
    background: var(--lovare-bg);
    transition: all 0.3s ease;
}

.client-search__input:focus {
    outline: none;
    border-color: var(--lovare-primary);
    background: var(--lovare-white);
}

.client-search__input::placeholder {
    color: var(--lovare-text-light);
}

.client-search__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.client-search.open .client-search__input {
    border-radius: 10px 10px 0 0;
    border-color: var(--lovare-primary);
}

.client-search__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--lovare-white);
    border: 2px solid var(--lovare-primary);
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px var(--lovare-shadow);
}

.client-search.open .client-search__list {
    display: block;
}

.client-search__option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.client-search__option:hover {
    background: var(--lovare-bg);
}

.client-search__option--selected {
    background: var(--lovare-primary-light);
    font-weight: 500;
}

.client-search__name {
    font-size: 14px;
    color: var(--lovare-text);
}

.client-search__nip {
    font-size: 12px;
    color: var(--lovare-text-light);
    font-family: monospace;
    white-space: nowrap;
}

.client-search__empty {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--lovare-text-light);
    text-align: center;
}

.client-search__list::-webkit-scrollbar {
    width: 6px;
}

.client-search__list::-webkit-scrollbar-track {
    background: transparent;
}

.client-search__list::-webkit-scrollbar-thumb {
    background: var(--lovare-primary-light);
    border-radius: 3px;
}

.client-search__list::-webkit-scrollbar-thumb:hover {
    background: var(--lovare-primary);
}

.custom-select__options::-webkit-scrollbar {
    width: 6px;
}

.custom-select__options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select__options::-webkit-scrollbar-thumb {
    background: var(--lovare-primary-light);
    border-radius: 3px;
}

.custom-select__options::-webkit-scrollbar-thumb:hover {
    background: var(--lovare-primary);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--lovare-primary-light);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--lovare-bg);
    margin-bottom: 16px;
}

.drop-zone:hover {
    border-color: var(--lovare-primary);
    background: var(--lovare-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--lovare-shadow);
}

.drop-zone.dragover {
    border-color: var(--lovare-primary-dark);
    background: var(--lovare-white);
    transform: scale(1.01);
}

.drop-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--lovare-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--lovare-primary-dark);
}

.drop-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--lovare-text);
    margin-bottom: 4px;
}

.drop-subtext {
    font-size: 12px;
    color: var(--lovare-text-light);
}

input[type="file"] {
    display: none;
}

/* Status Messages */
.status {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.status.success {
    background: rgba(94, 148, 98, 0.2);
    color: #8DC491;
    border: 1px solid rgba(94, 148, 98, 0.35);
}

.status.error {
    background: rgba(196, 112, 112, 0.2);
    color: #E0A0A0;
    border: 1px solid rgba(196, 112, 112, 0.35);
}

.status a {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--lovare-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.status a:hover {
    background: var(--lovare-primary-dark);
}

.new-import-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 8px 16px;
    background: var(--lovare-text-light);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.new-import-btn:hover {
    background: var(--lovare-text);
}

/* Missing Products Warning */
.missing-products {
    background: rgba(196, 160, 100, 0.15);
    border: 1px solid rgba(196, 160, 100, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.missing-products h4 {
    font-size: 13px;
    font-weight: 600;
    color: #D4B478;
    margin-bottom: 10px;
}

.missing-products ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.missing-products li {
    font-size: 13px;
    color: #D4B478;
    padding: 4px 0;
    border-bottom: 1px solid rgba(196, 160, 100, 0.15);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.missing-products li:last-child {
    border-bottom: none;
}

.missing-products .ean-code {
    font-family: monospace;
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}

/* Stock Warning Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--lovare-white);
    border-radius: 16px;
    padding: 32px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.modal__title {
    font-size: 16px;
    font-weight: 600;
    color: #D4B478;
    margin-bottom: 8px;
}

.modal__desc {
    font-size: 13px;
    color: var(--lovare-text-light);
    margin-bottom: 16px;
}

.modal__table-wrap {
    overflow-y: auto;
    max-height: 50vh;
    margin-bottom: 20px;
}

.modal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modal__table thead th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--lovare-text);
    border-bottom: 2px solid var(--lovare-primary-light);
    white-space: nowrap;
}

.modal__table tbody td {
    padding: 8px 10px;
    color: var(--lovare-text-light);
    border-bottom: 1px solid rgba(196, 135, 122, 0.1);
}

.modal__table tbody td:first-child {
    color: var(--lovare-text);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal__table tbody td:nth-child(2) {
    font-family: monospace;
    font-size: 12px;
}

.modal__table tbody td:nth-child(3) {
    color: var(--lovare-error);
    font-weight: 500;
    text-align: center;
}

.modal__table tbody td:nth-child(4) {
    color: var(--lovare-success);
    font-weight: 500;
    text-align: center;
}

.modal__close-btn {
    align-self: flex-end;
    padding: 10px 24px;
    background: var(--lovare-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal__close-btn:hover {
    background: var(--lovare-primary-dark);
}

.modal__table-wrap::-webkit-scrollbar {
    width: 6px;
}

.modal__table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.modal__table-wrap::-webkit-scrollbar-thumb {
    background: var(--lovare-primary-light);
    border-radius: 3px;
}

/* Loading */
.loading {
    text-align: center;
    display: none;
    padding: 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--lovare-primary-light);
    border-top-color: var(--lovare-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: var(--lovare-text-light);
}

/* Info Box */
.info-box {
    background: var(--lovare-bg);
    border-radius: 12px;
    padding: 14px 20px;
    margin-top: 12px;
}

.info-box h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--lovare-text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-box ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-box li {
    font-size: 11px;
    color: var(--lovare-text-light);
    padding-left: 16px;
    position: relative;
}

.info-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 4px;
    height: 4px;
    background: var(--lovare-primary);
    border-radius: 50%;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(196, 135, 122, 0.2);
    font-size: 11px;
    color: var(--lovare-text-light);
    letter-spacing: 0.5px;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.login-container {
    max-width: 420px;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

.login-form {
    margin-top: 8px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--lovare-text);
    margin-bottom: 8px;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--lovare-text);
    background: var(--lovare-bg);
    transition: all 0.3s ease;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--lovare-primary);
    background: var(--lovare-white);
}

.login-form input[type="password"]::placeholder {
    color: var(--lovare-text-light);
}

.login-error {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #E0A0A0;
    background: rgba(196, 112, 112, 0.2);
    border: 1px solid rgba(196, 112, 112, 0.35);
}

.login-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: var(--lovare-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s ease;
    letter-spacing: 0.5px;
}

.login-btn:hover {
    background: var(--lovare-primary-dark);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* App Header (with logout) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.app-header .lang-switcher {
    margin-bottom: 0;
}

.logout-btn {
    padding: 6px 14px;
    border: 2px solid var(--lovare-primary-light);
    border-radius: 6px;
    background: transparent;
    color: var(--lovare-text-light);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: var(--lovare-error);
    color: var(--lovare-error);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 32px 24px;
    }

    .drop-zone {
        padding: 36px 20px;
    }

    .info-box ul {
        grid-template-columns: 1fr;
    }

    .options-row {
        grid-template-columns: 1fr;
    }
}
