/* Estilos customizados para Magazine Alcione */

:root {
    /* Flutter palette (magazine_alcione/lib/app/theme/app_colors.dart) */
    --primary-color: #a42c2c;
    --primary-dark: #8c2c2c;
    --primary-highlight: #ac2c24;
    --success-color: #2e7d32;
    --danger-color: #d32f2f;
    --warning-color: #f57c00;
    --light-bg: #f7f7f7;
    --surface-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --divider-color: #e6e6e6;
    --primary-soft: rgba(164, 44, 44, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
}

/* Bootstrap color overrides */
.bg-primary,
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-outline-warning {
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

.navbar .nav-link.active {
    background: var(--primary-soft);
    border-radius: 8px;
}

.card {
    border-color: var(--divider-color);
    border-radius: 14px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(164, 44, 44, 0.2);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* Navbar customizado */
.navbar-brand {
    font-weight: bold;
}

/* Cards */
.card-action {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Página de balanço */
.balanco-container {
    max-width: 600px;
    margin: 0 auto;
}

.barcode-input {
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
}

.quantidade-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.quantidade-control .btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
}

.quantidade-display {
    font-size: 2rem;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

/* Alertas */
.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading UX global */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(1px);
}

.spinner-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.spinner-overlay-text {
    font-size: 0.92rem;
    color: #2b2b2b;
    margin: 0;
}

/* Preview de imagem de produto (hover no código) */
.product-image-preview {
    position: fixed;
    z-index: 10001;
    width: 220px;
    min-height: 130px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.product-image-preview img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: #f7f7f7;
}

.product-image-preview .preview-caption {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

.product-code-hover {
    cursor: zoom-in;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

/* Setor selector */
.setor-select {
    font-size: 1.1rem;
}

/* Botões de ação */
.btn-lg-custom {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

/* Responsividade */
@media (max-width: 576px) {
    .login-card {
        margin: 1rem;
    }

    .balanco-container {
        padding: 1rem;
    }

    .quantidade-display {
        font-size: 1.5rem;
    }
}
