/**
 * Delivery Profit Calculator - Styles
 * Mobile-first responsive design
 */

/* Variables */
:root {
    --dpc-primary: #007bff;
    --dpc-primary-dark: #0056b3;
    --dpc-success: #28a745;
    --dpc-success-dark: #1e7e34;
    --dpc-danger: #dc3545;
    --dpc-light: #f8f9fa;
    --dpc-dark: #343a40;
    --dpc-gray: #6c757d;
    --dpc-border: #dee2e6;
    --dpc-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    --dpc-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --dpc-radius: 8px;
    --dpc-radius-sm: 4px;
    --dpc-transition: all 0.3s ease;
}

/* Reset & Base */
.dpc-calculator-wrapper * {
    box-sizing: border-box;
}

body.dpc-modal-open {
    overflow: hidden;
}

/* Main Wrapper */
.dpc-calculator-wrapper {
    max-width: 600px;
    margin: 2rem auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--dpc-radius);
    box-shadow: var(--dpc-shadow);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.dpc-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dpc-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dpc-dark);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.dpc-subtitle {
    font-size: 1rem;
    color: var(--dpc-gray);
    margin: 0;
    line-height: 1.5;
}

/* Steps */
.dpc-step {
    display: none;
}

.dpc-step.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Input Groups */
.dpc-input-group {
    margin-bottom: 1.5rem;
}

.dpc-input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dpc-dark);
    margin-bottom: 0.5rem;
}

.dpc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dpc-input-wrapper input {
    flex: 1;
    padding: 0.75rem 3rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--dpc-border);
    border-radius: var(--dpc-radius-sm);
    transition: var(--dpc-transition);
    width: 100%;
}

.dpc-input-wrapper input:focus {
    outline: none;
    border-color: var(--dpc-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.dpc-currency {
    position: absolute;
    right: 1rem;
    font-weight: 600;
    color: var(--dpc-gray);
    pointer-events: none;
}

/* Stepper */
.dpc-stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dpc-stepper input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
    border: 2px solid var(--dpc-border);
    border-radius: var(--dpc-radius-sm);
    font-weight: 600;
}

.dpc-stepper input:focus {
    outline: none;
    border-color: var(--dpc-primary);
}

.dpc-stepper-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--dpc-border);
    background: #fff;
    border-radius: var(--dpc-radius-sm);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dpc-gray);
    cursor: pointer;
    transition: var(--dpc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpc-stepper-btn:hover {
    background: var(--dpc-light);
    border-color: var(--dpc-primary);
    color: var(--dpc-primary);
}

.dpc-stepper-btn:active {
    transform: scale(0.95);
}

/* Tooltip */
.dpc-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--dpc-gray);
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
}

.dpc-tooltip-text {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dpc-dark);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: var(--dpc-radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
    animation: tooltipFade 0.2s ease;
}

.dpc-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--dpc-dark);
}

@keyframes tooltipFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Buttons */
.dpc-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--dpc-radius-sm);
    cursor: pointer;
    transition: var(--dpc-transition);
    width: 100%;
}

.dpc-btn-primary {
    background: var(--dpc-primary);
    color: #fff;
}

.dpc-btn-primary:hover {
    background: var(--dpc-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.dpc-btn-cta {
    background: #c8ddfd;
    color: #333;
    border: 2px solid #a8c8f0;
}

.dpc-btn-cta:hover {
    background: #b8d3fc;
    color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 221, 253, 0.4);
}

/* Modal */
.dpc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
}

.dpc-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dpc-modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--dpc-radius);
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: var(--dpc-shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dpc-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--dpc-gray);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.dpc-modal-close:hover {
    color: var(--dpc-dark);
}

.dpc-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dpc-dark);
    margin: 0 0 0.5rem 0;
}

.dpc-modal-subtitle {
    font-size: 0.95rem;
    color: var(--dpc-gray);
    margin: 0 0 1.5rem 0;
}

/* Checkbox */
.dpc-checkbox-group {
    margin-bottom: 1.5rem;
}

.dpc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.dpc-checkbox-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.dpc-checkbox-label a {
    color: var(--dpc-primary);
    text-decoration: underline;
}

/* Trust Badge */
.dpc-trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dpc-border);
    font-size: 0.9rem;
    color: var(--dpc-gray);
}

/* Results */
.dpc-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dpc-dark);
    text-align: center;
    margin: 0 0 2rem 0;
}

/* Results Table */
.dpc-results-table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: var(--dpc-radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dpc-results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.dpc-results-table thead {
    background: var(--dpc-light);
}

.dpc-results-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dpc-dark);
    border-bottom: 2px solid var(--dpc-border);
}

.dpc-results-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--dpc-border);
    font-size: 0.95rem;
}

.dpc-results-table tbody tr:last-child td {
    border-bottom: none;
}

.dpc-result-best {
    background: #d4edda !important;
}

.dpc-badge-best {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--dpc-success);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Chart */
.dpc-chart-wrapper {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--dpc-light);
    border-radius: var(--dpc-radius-sm);
}

.dpc-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dpc-dark);
    margin: 0 0 1rem 0;
    text-align: center;
}

/* CTA Box */
.dpc-cta-box {
    padding: 2rem;
    background: #cae4d9;
    color: #333;
    border-radius: var(--dpc-radius);
    text-align: center;
}

.dpc-cta-image {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dpc-megafono-img {
    max-width: 120px;
    height: auto;
    display: block;
}

.dpc-cta-box h4 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem 0;
}

.dpc-cta-box p {
    margin: 0 0 1.5rem 0;
    opacity: 0.9;
}

.dpc-cta-box .dpc-btn-cta {
    margin-bottom: 1rem;
}

.dpc-scarcity {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0 !important;
}

/* Loading */
.dpc-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.dpc-loading.active {
    display: flex;
}

.dpc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--dpc-border);
    border-top-color: var(--dpc-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.dpc-loading p {
    margin-top: 1rem;
    color: var(--dpc-gray);
    font-weight: 600;
}

/* Responsive - Tablet */
@media (min-width: 768px) {
    .dpc-calculator-wrapper {
        padding: 2.5rem;
    }
    
    .dpc-title {
        font-size: 2rem;
    }
    
    .dpc-subtitle {
        font-size: 1.1rem;
    }
    
    .dpc-results-table th,
    .dpc-results-table td {
        padding: 1.25rem;
    }
    
    .dpc-megafono-img {
        max-width: 140px;
    }
}

/* Responsive - Desktop */
@media (min-width: 1024px) {
    .dpc-calculator-wrapper {
        max-width: 700px;
    }
    
    .dpc-modal-content {
        max-width: 550px;
    }
}

/* Print Styles */
@media print {
    .dpc-calculator-wrapper {
        box-shadow: none;
    }
    
    .dpc-step-input,
    .dpc-modal,
    .dpc-loading,
    .dpc-cta-box {
        display: none !important;
    }
    
    .dpc-step-results {
        display: block !important;
    }
}

