/**
 * EgyPoxy Calculator - Frontend Styles
 * 
 * @package EgyPoxy_Calculator
 * @since 4.0.0
 */

/* Variables */
:root {
    --egypoxy-primary: #FF9900;
    --egypoxy-secondary: #3D3D3D;
    --egypoxy-success: #28a745;
    --egypoxy-danger: #dc3545;
    --egypoxy-info: #17a2b8;
    --egypoxy-light: #f8f9fa;
    --egypoxy-dark: #343a40;
    --egypoxy-border: #ddd;
    --egypoxy-radius: 8px;
    --egypoxy-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Calculator Wrapper */
.egypoxy-calculator-wrapper {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: var(--egypoxy-radius);
    box-shadow: var(--egypoxy-shadow);
}

.egypoxy-calculator-title {
    text-align: center;
    color: var(--egypoxy-secondary);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: bold;
}

/* Form Sections */
.egypoxy-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--egypoxy-light);
    border-radius: var(--egypoxy-radius);
}

.egypoxy-form-section h3 {
    color: var(--egypoxy-primary);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid var(--egypoxy-primary);
    padding-bottom: 10px;
}

/* Form Rows */
.egypoxy-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Form Fields */
.egypoxy-form-field {
    display: flex;
    flex-direction: column;
}

.egypoxy-form-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--egypoxy-secondary);
}

.egypoxy-form-field .required {
    color: var(--egypoxy-danger);
}

.egypoxy-form-field input,
.egypoxy-form-field select {
    padding: 12px;
    border: 2px solid var(--egypoxy-border);
    border-radius: var(--egypoxy-radius);
    font-size: 16px;
    transition: border-color 0.3s;
}

.egypoxy-form-field input:focus,
.egypoxy-form-field select:focus {
    outline: none;
    border-color: var(--egypoxy-primary);
}

/* Buttons */
.egypoxy-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.egypoxy-btn {
    padding: 14px 30px;
    border: none;
    border-radius: var(--egypoxy-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.egypoxy-btn-primary:hover {
    background: #e68a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.egypoxy-btn-secondary {
    background: var(--egypoxy-secondary);
    color: #fff;
}

.egypoxy-btn-secondary:hover {
    background: #2a2a2a;
}

.egypoxy-btn-success {
    background: var(--egypoxy-success);
    color: #fff;
}

.egypoxy-btn-success:hover {
    background: #218838;
}

.egypoxy-btn-info {
    background: var(--egypoxy-info);
    color: #fff;
}

.egypoxy-btn-info:hover {
    background: #138496;
}

/* Results Section */
.egypoxy-results {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--egypoxy-radius);
    border: 2px solid var(--egypoxy-primary);
}

.egypoxy-results h3 {
    color: var(--egypoxy-primary);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    text-align: center;
}

/* Results Summary */
.egypoxy-results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.egypoxy-summary-item {
    padding: 15px;
    background: #fff;
    border-radius: var(--egypoxy-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.egypoxy-summary-label {
    display: block;
    font-weight: 600;
    color: var(--egypoxy-secondary);
    margin-bottom: 5px;
}

.egypoxy-summary-value {
    display: block;
    font-size: 18px;
    color: var(--egypoxy-primary);
    font-weight: bold;
}

/* Products Table */
.egypoxy-products-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.egypoxy-products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--egypoxy-radius);
    overflow: hidden;
}

.egypoxy-products-table th {
    background: var(--egypoxy-secondary);
    color: #fff;
    padding: 15px;
    text-align: right;
    font-weight: 600;
}

.egypoxy-products-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--egypoxy-border);
}

.egypoxy-products-table tbody tr:hover {
    background: #f8f9fa;
}

.egypoxy-products-table tfoot tr {
    background: var(--egypoxy-primary);
    color: #fff;
    font-weight: bold;
    font-size: 18px;
}

.egypoxy-products-table tfoot td {
    border-bottom: none;
    padding: 15px;
}

.egypoxy-total-label {
    text-align: left !important;
}

.egypoxy-total-value {
    text-align: right !important;
}

/* Results Actions */
.egypoxy-results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Loading Overlay */
.egypoxy-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.egypoxy-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--egypoxy-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.egypoxy-loading p {
    color: #fff;
    margin-top: 20px;
    font-size: 18px;
}

/* Messages */
.egypoxy-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: var(--egypoxy-radius);
    font-weight: 500;
}

.egypoxy-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.egypoxy-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.egypoxy-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .egypoxy-calculator-wrapper {
        padding: 20px;
        margin: 15px;
    }
    
    .egypoxy-calculator-title {
        font-size: 22px;
    }
    
    .egypoxy-form-row {
        grid-template-columns: 1fr;
    }
    
    .egypoxy-form-actions,
    .egypoxy-results-actions {
        flex-direction: column;
    }
    
    .egypoxy-btn {
        width: 100%;
    }
    
    .egypoxy-results-summary {
        grid-template-columns: 1fr;
    }
    
    .egypoxy-products-table {
        font-size: 14px;
    }
    
    .egypoxy-products-table th,
    .egypoxy-products-table td {
        padding: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .egypoxy-products-table th,
[dir="rtl"] .egypoxy-products-table td {
    text-align: right;
}

/* Print Styles */
@media print {
    .egypoxy-form-actions,
    .egypoxy-results-actions {
        display: none;
    }
    
    .egypoxy-calculator-wrapper {
        box-shadow: none;
    }
}

