/* Safety First - Fire Extinguisher Calculator Styles */

:root {
    --sffc-primary: #c41e3a;
    --sffc-primary-dark: #a01830;
    --sffc-secondary: #2c3e50;
    --sffc-success: #27ae60;
    --sffc-warning: #f39c12;
    --sffc-danger: #e74c3c;
    --sffc-light: #f8f9fa;
    --sffc-border: #dee2e6;
    --sffc-text: #333;
    --sffc-text-muted: #6c757d;
    --sffc-radius: 8px;
    --sffc-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --sffc-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Main Container */
.sffc-calculator {
    max-width: 900px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.sffc-calculator * {
    box-sizing: border-box;
}

/* Card Styling */
.sffc-card {
    background: #fff;
    border-radius: var(--sffc-radius);
    box-shadow: var(--sffc-shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sffc-card-header {
    background: linear-gradient(135deg, var(--sffc-primary), var(--sffc-primary-dark));
    color: #fff;
    padding: 1.25rem 1.5rem;
}

.sffc-card-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sffc-card-header h2 svg {
    width: 28px;
    height: 28px;
}

.sffc-card-body {
    padding: 1.5rem;
}

/* Form Elements */
.sffc-form-group {
    margin-bottom: 1.5rem;
}

.sffc-form-group:last-child {
    margin-bottom: 0;
}

.sffc-label {
    display: block;
    font-weight: 600;
    color: var(--sffc-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.sffc-label .required {
    color: var(--sffc-danger);
}

.sffc-select,
.sffc-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--sffc-border);
    border-radius: var(--sffc-radius);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.sffc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.sffc-select:focus,
.sffc-input:focus {
    outline: none;
    border-color: var(--sffc-primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.sffc-input[type="number"] {
    font-variant-numeric: tabular-nums;
}

.sffc-help-text {
    font-size: 0.85rem;
    color: var(--sffc-text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Input with suffix */
.sffc-input-group {
    display: flex;
    align-items: stretch;
}

.sffc-input-group .sffc-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.sffc-input-suffix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--sffc-light);
    border: 2px solid var(--sffc-border);
    border-left: none;
    border-radius: 0 var(--sffc-radius) var(--sffc-radius) 0;
    font-weight: 500;
    color: var(--sffc-text-muted);
}

/* Submit Button */
.sffc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--sffc-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sffc-btn-primary {
    background: linear-gradient(135deg, var(--sffc-primary), var(--sffc-primary-dark));
    color: #fff;
    width: 100%;
}

.sffc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--sffc-shadow-lg);
}

.sffc-btn-primary:active {
    transform: translateY(0);
}

.sffc-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sffc-btn-success {
    background: linear-gradient(135deg, var(--sffc-success), #219a52);
    color: #fff;
}

.sffc-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--sffc-shadow-lg);
}

.sffc-btn svg {
    width: 20px;
    height: 20px;
}

/* Loading Spinner */
.sffc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: sffc-spin 0.8s linear infinite;
}

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

/* Results Section */
.sffc-results {
    display: none;
    animation: sffc-fadeIn 0.3s ease;
}

.sffc-results.active {
    display: block;
}

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

/* Summary Box */
.sffc-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--sffc-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sffc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.sffc-summary-item {
    text-align: center;
    padding: 1rem;
    background: #fff;
    border-radius: var(--sffc-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sffc-summary-label {
    font-size: 0.85rem;
    color: var(--sffc-text-muted);
    margin-bottom: 0.25rem;
}

.sffc-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sffc-secondary);
}

.sffc-summary-value.highlight {
    color: var(--sffc-primary);
}

/* Products List */
.sffc-products-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sffc-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sffc-products-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sffc-product-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--sffc-border);
    border-radius: var(--sffc-radius);
    transition: box-shadow 0.2s;
}

.sffc-product-item:hover {
    box-shadow: var(--sffc-shadow);
}

.sffc-product-image {
    width: 80px;
    height: 80px;
    border-radius: var(--sffc-radius);
    object-fit: cover;
    background: var(--sffc-light);
    flex-shrink: 0;
}

.sffc-product-info {
    flex: 1;
    min-width: 0;
}

.sffc-product-name {
    font-weight: 600;
    color: var(--sffc-secondary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sffc-product-name a {
    color: inherit;
    text-decoration: none;
}

.sffc-product-name a:hover {
    color: var(--sffc-primary);
}

.sffc-product-details {
    font-size: 0.9rem;
    color: var(--sffc-text-muted);
}

.sffc-product-jg {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--sffc-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.sffc-product-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--sffc-primary);
    color: #fff;
    border-radius: var(--sffc-radius);
    min-width: 60px;
}

.sffc-product-quantity .qty {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.sffc-product-quantity .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sffc-product-price {
    text-align: right;
    min-width: 100px;
}

.sffc-product-unit-price {
    font-size: 0.85rem;
    color: var(--sffc-text-muted);
}

.sffc-product-total-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sffc-secondary);
}

/* Total Section */
.sffc-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--sffc-secondary);
    color: #fff;
    border-radius: var(--sffc-radius);
    margin-top: 1.5rem;
}

.sffc-total-label {
    font-size: 1.1rem;
    font-weight: 500;
}

.sffc-total-price {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Actions */
.sffc-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.sffc-actions .sffc-btn {
    flex: 1;
}

/* Info Box */
.sffc-info-box {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 4px solid #2196f3;
    padding: 1rem 1.25rem;
    border-radius: 0 var(--sffc-radius) var(--sffc-radius) 0;
    margin-top: 1.5rem;
}

.sffc-info-box p {
    margin: 0;
    font-size: 0.9rem;
    color: #1565c0;
    line-height: 1.6;
}

.sffc-info-box strong {
    font-weight: 600;
}

/* Alerts */
.sffc-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--sffc-radius);
    margin-bottom: 1rem;
    display: none;
}

.sffc-alert.active {
    display: block;
    animation: sffc-fadeIn 0.3s ease;
}

.sffc-alert-error {
    background: #fce4ec;
    border: 1px solid #f8bbd9;
    color: #c62828;
}

.sffc-alert-success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

/* Responsive */
@media (max-width: 768px) {
    .sffc-calculator {
        margin: 1rem;
    }
    
    .sffc-card-body {
        padding: 1rem;
    }
    
    .sffc-product-item {
        flex-wrap: wrap;
    }
    
    .sffc-product-image {
        width: 60px;
        height: 60px;
    }
    
    .sffc-product-info {
        flex: 1 1 calc(100% - 80px);
    }
    
    .sffc-product-quantity,
    .sffc-product-price {
        flex: 1;
    }
    
    .sffc-product-price {
        text-align: left;
    }
    
    .sffc-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sffc-actions {
        flex-direction: column;
    }
    
    .sffc-total {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .sffc-btn,
    .sffc-actions {
        display: none !important;
    }
    
    .sffc-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
