/**
 * Numerology Calculator Plugin CSS
 * 
 * @package NumerologyCalculator
 * @version 1.2.0
 */

/* =============================================================================
   BASE CALCULATOR STYLES
   ============================================================================= */

.numerology-calculator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 20px 0;
}

.numerology-calculator {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.calculator-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.calculator-description {
    padding: 15px 20px 0;
    color: #666;
    text-align: center;
    margin: 0;
}

/* =============================================================================
   FORM STYLES
   ============================================================================= */

.numerology-form {
    padding: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.1);
}

.form-input:invalid {
    border-color: #e74c3c;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.calculate-button {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 200px;
}

.calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.3);
}

.calculate-button:active {
    transform: translateY(0);
}

.calculate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* =============================================================================
   RESULTS STYLES
   ============================================================================= */

.calculation-results {
    padding: 0 30px 30px;
}

.results-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.results-grid {
    display: grid;
    gap: 20px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #8e44ad;
    transition: transform 0.2s ease;
}

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

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.result-number {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
}

.result-label {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.result-title {
    color: #8e44ad;
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
}

.result-meaning {
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* =============================================================================
   MINI CALCULATOR STYLES
   ============================================================================= */

.mini-calculator .numerology-calculator {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mini-calculator .calculator-title {
    padding: 15px;
    font-size: 1.2rem;
}

.mini-form {
    padding: 20px;
}

.mini-form-row {
    display: flex;
    gap: 10px;
    align-items: end;
}

.mini-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
}

.mini-button {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 6px;
    min-width: auto;
    white-space: nowrap;
}

.mini-results {
    padding: 0 20px 20px;
}

.mini-results-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* =============================================================================
   LIFE PATH ONLY STYLES
   ============================================================================= */

.life-path-only .form-group {
    max-width: 300px;
    margin: 0 auto 20px;
}

.life-path-result {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin: 20px 0;
}

.life-path-result .result-number {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: none;
    width: auto;
    height: auto;
    border-radius: 0;
    display: block;
}

/* =============================================================================
   WIDGET STYLES
   ============================================================================= */

.numerology-widget-calculator {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.widget-description {
    padding: 15px 15px 0;
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.numerology-widget-form {
    padding: 15px;
}

.widget-form-group {
    margin-bottom: 15px;
}

.widget-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.widget-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.widget-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 2px rgba(142, 68, 173, 0.1);
}

.widget-calculate-button {
    width: 100%;
    background: #8e44ad;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.widget-calculate-button:hover {
    background: #9b59b6;
}

.widget-results {
    padding: 0 15px 15px;
}

.widget-result-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.widget-result-item:last-child {
    margin-bottom: 0;
}

/* =============================================================================
   ERROR STYLES
   ============================================================================= */

.error-message,
.widget-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

/* =============================================================================
   STYLE VARIATIONS
   ============================================================================= */

/* Classic Style */
[data-style="classic"] .numerology-calculator {
    border: 2px solid #8e44ad;
    box-shadow: none;
}

[data-style="classic"] .calculator-title {
    background: #8e44ad;
}

[data-style="classic"] .form-input {
    border-radius: 4px;
}

[data-style="classic"] .calculate-button {
    border-radius: 4px;
    background: #8e44ad;
}

[data-style="classic"] .result-card {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Minimal Style */
[data-style="minimal"] .numerology-calculator {
    box-shadow: none;
    border: 1px solid #e9ecef;
}

[data-style="minimal"] .calculator-title {
    background: #f8f9fa;
    color: #2c3e50;
}

[data-style="minimal"] .form-input {
    border: 1px solid #ddd;
    border-radius: 4px;
}

[data-style="minimal"] .calculate-button {
    background: #2c3e50;
    border-radius: 4px;
}

[data-style="minimal"] .result-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* =============================================================================
   COLOR VARIATIONS
   ============================================================================= */

/* Secondary Color (Blue) */
[data-color="secondary"] .calculator-title,
[data-color="secondary"] .calculate-button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

[data-color="secondary"] .form-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

[data-color="secondary"] .result-card {
    border-left-color: #3498db;
}

[data-color="secondary"] .result-number {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

[data-color="secondary"] .result-title {
    color: #3498db;
}

/* Accent Color (Green) */
[data-color="accent"] .calculator-title,
[data-color="accent"] .calculate-button {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

[data-color="accent"] .form-input:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

[data-color="accent"] .result-card {
    border-left-color: #27ae60;
}

[data-color="accent"] .result-number {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

[data-color="accent"] .result-title {
    color: #27ae60;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .mini-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .mini-form-row .mini-input {
        margin-bottom: 0;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .result-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .calculate-button {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .numerology-form,
    .calculation-results {
        padding: 20px;
    }
    
    .calculator-title {
        padding: 15px;
        font-size: 1.3rem;
    }
    
    .form-input {
        padding: 10px 12px;
    }
    
    .calculate-button {
        width: 100%;
        padding: 12px 20px;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-number {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
}

/* =============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.calculate-button:focus,
.form-input:focus,
.widget-input:focus,
.widget-calculate-button:focus {
    outline: 2px solid #8e44ad;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .calculator-title,
    .calculate-button {
        background: #000;
        border: 2px solid #fff;
    }
    
    .form-input {
        border: 2px solid #000;
    }
    
    .result-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .calculate-button,
    .result-card,
    .form-input {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .numerology-calculator-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .calculator-title {
        background: #000 !important;
        color: #fff !important;
    }
    
    .calculate-button {
        display: none;
    }
    
    .result-card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}