/**
 * Saly Inventory Calculator Styles
 * Version: 1.4.0
 * Redesign: Clean, minimalist, DaisyUI-inspired design
 */

/* CSS Variables - Semantic Color System */
:root {
    /* Primary colors - Saly brand */
    --color-primary: #010ED0;
    --color-primary-hover: #242627;

    /* Semantic colors */
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-success: #10b981;
    --color-info: #3b82f6;

    /* Neutral scale */
    --color-base-100: #ffffff;
    --color-base-200: #f9fafb;
    --color-base-300: #e5e7eb;
    --color-base-content: #242627;

    /* Shadows - minimalist */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);

    /* Spacing scale (4px base) */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
}

/* Container główny */
.saly-inventory-calculator {
    max-width: 800px;
    margin: var(--spacing-8) auto;
    padding: var(--spacing-8);
    background: var(--color-base-100);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-base-300);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    position: relative;
}

/* Typography */
.saly-inventory-calculator h2 {
    color: #242627;
    margin-bottom: 1.5rem;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
}

.saly-inventory-calculator h3 {
    color: #242627;
    margin-bottom: 1rem;
    font-size: 20px;
    font-weight: 600;
}

.saly-inventory-calculator h4 {
    color: #242627;
    margin-bottom: 0.75rem;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-description {
    color: #242627;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    font-size: 20px;
    line-height: 1.6;
}

/* Progress Bar */
.saly-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
}

.saly-progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.progress-step {
    position: relative;
    text-align: center;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 600;
    margin: 0 auto 8px;
    transition: all 0.3s ease;
}

.step-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.progress-step.active .step-number {
    background: #010ED0;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(1, 14, 208, 0.3);
}

.progress-step.completed .step-number {
    background: #10b981;
    color: white;
}

.progress-step.completed .step-number {
    font-size: 0;
}

.progress-step.completed .step-number::after {
    content: '✓';
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.calculator-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.calculator-step.active {
    display: block;
}

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

.saly-form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #1f2937;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #010ED0;
    box-shadow: 0 0 0 3px rgba(1, 14, 208, 0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-group input.error:focus,
.form-group select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-error {
    display: block;
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

/* Tooltips */
.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    width: 16px;
    height: 16px;
    background: #6b7280;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    position: relative;
    transition: all 0.2s ease;
}

.tooltip:hover {
    background: #4b5563;
    transform: scale(1.1);
}

.tooltip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tooltip[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #1f2937;
    z-index: 1001;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    margin: 20px 0;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
}

/* Buttons */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #010ED0;
    color: white;
    border-radius: 9999px;
    font-weight: 600;
}

.btn-primary:hover {
    background: #242627;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(1, 14, 208, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

/* Results Section */
.results-container {
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-headline {
    background: var(--color-base-100);
    border-left: 4px solid var(--color-error);
    padding: var(--spacing-8);
    margin-bottom: var(--spacing-6);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-base-300);
    border-left: 4px solid var(--color-error);
}

.result-headline h2 {
    color: var(--color-base-content);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--spacing-4);
    line-height: 1.3;
}

.loss-amount {
    font-size: 56px;
    font-weight: 700;
    color: var(--color-error);
    display: block;
    margin: var(--spacing-4) 0;
    line-height: 1;
}

.subheadline {
    font-size: 18px;
    color: var(--color-base-content);
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.6;
}

.result-section {
    background: var(--color-base-100);
    border: 1px solid var(--color-base-300);
    border-radius: 8px;
    padding: var(--spacing-6);
    margin-bottom: var(--spacing-4);
}

/* Cost Breakdown Table */
.cost-breakdown table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-4);
}

.cost-breakdown td {
    padding: var(--spacing-3) var(--spacing-4);
    border-bottom: 1px solid var(--color-base-300);
    font-size: 15px;
    line-height: 1.6;
}

.cost-breakdown tr:last-child td {
    border-bottom: none;
}

.cost-breakdown .total-row {
    background: var(--color-base-200);
    font-weight: 600;
    border-top: 2px solid var(--color-base-300);
}

.cost-breakdown .value {
    text-align: right;
    color: var(--color-error);
    font-weight: 600;
    font-size: 16px;
}

.cost-breakdown .percent {
    text-align: right;
    width: 80px;
}

.percent-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* Big Numbers */
.big-number {
    font-size: 36px;
    font-weight: 700;
    color: #dc2626;
    margin: 16px 0;
}

/* Benchmark Stats - DaisyUI inspired */
.benchmark-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    margin-top: var(--spacing-4);
}

@media (min-width: 768px) {
    .benchmark-stats {
        flex-direction: row;
    }
}

.stat-card {
    flex: 1;
    background: var(--color-base-100);
    border: 1px solid var(--color-base-300);
    border-radius: 8px;
    padding: var(--spacing-6);
    text-align: center;
    min-width: 0;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-base-content);
    opacity: 0.6;
    margin-bottom: var(--spacing-3);
}

.stat-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-base-content);
    line-height: 1;
    margin-bottom: var(--spacing-3);
}

.stat-desc {
    font-size: 14px;
    color: var(--color-base-content);
    opacity: 0.6;
    margin-bottom: var(--spacing-3);
}

/* Rating Badges - DaisyUI soft style */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rating-badge.excellent {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rating-badge.good {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.rating-badge.average {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.rating-badge.poor {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Savings Stats - Clean layout */
.savings-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    margin-top: var(--spacing-4);
}

@media (min-width: 768px) {
    .savings-stats {
        flex-direction: row;
    }
}

.savings-stat {
    flex: 1;
    background: var(--color-base-100);
    border: 2px solid var(--color-base-300);
    border-radius: 8px;
    padding: var(--spacing-6);
    text-align: center;
    transition: border-color 0.2s ease;
}

.savings-stat:hover {
    border-color: var(--color-primary);
}

.savings-stat-title {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-base-content);
    opacity: 0.6;
    margin-bottom: var(--spacing-4);
    line-height: 1.4;
}

.savings-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-success);
    line-height: 1;
}

/* Quick Wins - Alert style */
.quick-wins {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--color-warning);
    padding: var(--spacing-6);
    border-radius: 8px;
    margin: var(--spacing-6) 0;
}

.quick-wins h3 {
    color: var(--color-base-content);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-4);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.quick-wins ol {
    margin-left: 20px;
    margin-top: var(--spacing-3);
}

.quick-wins li {
    margin-bottom: var(--spacing-3);
    color: var(--color-base-content);
    line-height: 1.7;
    font-size: 15px;
}

.quick-wins li strong {
    color: var(--color-base-content);
    font-weight: 600;
}

/* CTA Section - Minimalist */
.results-cta {
    background: var(--color-base-200);
    padding: var(--spacing-8);
    border-radius: 8px;
    text-align: center;
    margin-top: var(--spacing-8);
    border: 1px solid var(--color-base-300);
}

.results-cta h3 {
    color: var(--color-base-content);
    margin-bottom: var(--spacing-6);
    font-size: 24px;
    font-weight: 600;
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-4);
    justify-content: center;
    margin-bottom: var(--spacing-8);
    flex-wrap: wrap;
}

.primary-cta,
.secondary-cta {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
}

.primary-cta {
    background: var(--color-primary);
    color: white;
    border: 2px solid var(--color-primary);
}

.primary-cta:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.secondary-cta {
    background: transparent;
    color: var(--color-base-content);
    border: 2px solid var(--color-base-300);
}

.secondary-cta:hover {
    background: var(--color-base-100);
    border-color: var(--color-base-content);
}

/* Webinar Invite - Info alert */
.webinar-invite {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid var(--color-info);
    padding: var(--spacing-6);
    border-radius: 8px;
    text-align: left;
    margin-top: var(--spacing-6);
}

.webinar-invite p {
    margin-bottom: var(--spacing-2);
    color: var(--color-base-content);
    font-size: 15px;
}

.webinar-invite p strong {
    font-size: 17px;
    font-weight: 600;
}

.webinar-invite button {
    margin-top: var(--spacing-4);
    padding: 10px 20px;
    background: var(--color-info);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.webinar-invite button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .saly-inventory-calculator {
        padding: 20px;
        margin: 20px auto;
    }
    
    .saly-progress-bar {
        padding: 0 10px;
    }
    
    .saly-progress-bar::before {
        left: 30px;
        right: 30px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .result-headline {
        padding: 30px 20px;
    }
    
    .result-headline h2 {
        font-size: 20px;
    }
    
    .loss-amount {
        font-size: 36px;
    }
    
    .benchmark-grid,
    .savings-scenarios {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn {
        width: 100%;
    }
    
    .cost-breakdown {
        overflow-x: auto;
    }
    
    .cost-breakdown table {
        min-width: 400px;
    }
}

@media (max-width: 480px) {
    .saly-inventory-calculator h2 {
        font-size: 22px;
    }
    
    .loss-amount {
        font-size: 28px;
    }
    
    .your-score {
        font-size: 28px;
    }
    
    .big-number {
        font-size: 28px;
    }
    
    .scenario .amount {
        font-size: 20px;
    }
}

/* Print Styles */
@media print {
    .saly-inventory-calculator {
        box-shadow: none;
        max-width: 100%;
    }
    
    .button-group,
    .cta-buttons,
    .webinar-invite button {
        display: none;
    }
    
    .result-section {
        page-break-inside: avoid;
    }
}
