/**
 * Paycheck Calculator Frontend Styles
 * Modern, responsive design with improved UX
 */

/* Calculator Container */
.pc-calculator-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
}

.pc-calculator-container * {
    box-sizing: border-box;
}

/* Notice Banner */
.pc-notice {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.pc-notice-icon {
    color: #f57c00;
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.pc-notice-content {
    color: #5d4037;
    font-size: 14px;
    line-height: 1.6;
}

.pc-notice-content strong {
    display: block;
    margin-bottom: 6px;
    color: #e65100;
    font-size: 15px;
}

/* Form Section */
.pc-form-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.pc-form-section h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    color: #1a1a1a;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

/* Form Grid */
.pc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.pc-form-group {
    margin-bottom: 0;
}

.pc-form-group.full-width {
    grid-column: 1 / -1;
}

.pc-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.pc-form-group label .required {
    color: #e53935;
    margin-left: 3px;
}

.pc-form-group input[type="text"],
.pc-form-group input[type="number"],
.pc-form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.25s ease;
    background: #fff;
    color: #333;
}

.pc-form-group input[type="text"]:focus,
.pc-form-group input[type="number"]:focus,
.pc-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.pc-form-group input::placeholder {
    color: #aaa;
}

.pc-input-prefix {
    position: relative;
}

.pc-input-prefix .prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
}

.pc-input-prefix input {
    padding-left: 40px !important;
}

/* Deduction Tabs */
.pc-deduction-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pc-deduction-tab {
    padding: 12px 24px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.25s ease;
}

.pc-deduction-tab:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
}

.pc-deduction-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pc-deduction-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.pc-deduction-content.active {
    display: block;
}

/* Calculate Button */
.pc-calculate-btn {
    width: 100%;
    padding: 20px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.pc-calculate-btn:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.45);
}

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

.pc-calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pc-calculate-btn .spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pc-calculate-btn.loading .spinner {
    display: inline-block;
}

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

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

/* Results Section */
.pc-results-section {
    display: none;
}

.pc-results-section.visible {
    display: block;
    animation: slideUp 0.5s ease;
}

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

/* Summary Cards */
.pc-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pc-summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.pc-summary-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.pc-summary-card.gross {
    border-top: 4px solid #667eea;
}

.pc-summary-card.net {
    border-top: 4px solid #10b981;
}

.pc-summary-card.tax {
    border-top: 4px solid #ef4444;
}

.pc-summary-card.rate {
    border-top: 4px solid #f59e0b;
}

.pc-summary-card h4 {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.pc-summary-card .amount {
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.pc-summary-card .label {
    font-size: 12px;
    color: #aaa;
}

/* Chart Container */
.pc-chart-container {
    background: #fff;
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.pc-chart-container h4 {
    margin: 0 0 25px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
    font-weight: 600;
}

.pc-chart-wrapper {
    max-width: 380px;
    margin: 0 auto;
}

/* Breakdown Table */
.pc-breakdown-section {
    background: #fff;
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
}

.pc-breakdown-section h4 {
    margin: 0 0 25px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.pc-breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.pc-breakdown-table th,
.pc-breakdown-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.pc-breakdown-table th {
    font-weight: 600;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafafa;
}

.pc-breakdown-table td {
    color: #444;
}

.pc-breakdown-table tr:hover td {
    background: #fafafa;
}

.pc-breakdown-table .rate {
    color: #888;
    font-size: 13px;
}

.pc-breakdown-table .amount {
    font-weight: 600;
    text-align: right;
    color: #333;
}

.pc-breakdown-table tfoot td {
    font-weight: 700;
    border-top: 2px solid #333;
    border-bottom: none;
    background: #fafafa;
}

/* Action Buttons */
.pc-action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.pc-action-btn {
    padding: 14px 28px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.pc-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.pc-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pc-action-btn.primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Countries Section */
.pc-countries-section {
    margin: 40px 0;
}

.pc-countries-section h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

.pc-countries-section > p {
    text-align: center;
    color: #666;
    margin-bottom: 35px;
}

/* Countries Grid */
.pc-countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pc-country-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.pc-country-card:hover {
    box-shadow: 0 10px 35px rgba(0,0,0,0.1);
    transform: translateY(-6px);
    border-color: #667eea;
}

.pc-country-flag {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.pc-country-card h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.pc-country-card p {
    margin: 0;
    font-size: 13px;
    color: #888;
}

/* FAQ Section */
.pc-faq-section {
    margin: 40px 0;
}

.pc-faq-section h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-align: center;
}

.pc-faq-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}

.pc-faq-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.pc-faq-question {
    padding: 22px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #333;
    transition: all 0.25s ease;
    font-size: 15px;
}

.pc-faq-question:hover {
    background: #fafafa;
}

.pc-faq-question::after {
    content: '+';
    font-size: 26px;
    color: #667eea;
    transition: all 0.3s ease;
    font-weight: 300;
}

.pc-faq-item.active .pc-faq-question::after {
    transform: rotate(45deg);
}

.pc-faq-item.active .pc-faq-question {
    background: #f8f9ff;
    color: #667eea;
}

.pc-faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.35s ease;
}

.pc-faq-item.active .pc-faq-answer {
    padding: 0 25px 22px;
    max-height: 500px;
}

.pc-faq-answer p {
    margin: 0;
    color: #666;
    line-height: 1.7;
    font-size: 14px;
}

/* Description text */
.description {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .pc-form-section {
        padding: 25px 20px;
    }
    
    .pc-form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .pc-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .pc-summary-card {
        padding: 20px 15px;
    }
    
    .pc-summary-card .amount {
        font-size: 22px;
    }
    
    .pc-deduction-tabs {
        justify-content: center;
    }
    
    .pc-deduction-tab {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .pc-calculate-btn {
        font-size: 16px;
        padding: 18px 25px;
    }
    
    .pc-action-buttons {
        flex-direction: column;
    }
    
    .pc-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pc-chart-container,
    .pc-breakdown-section {
        padding: 25px 20px;
    }
    
    .pc-countries-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .pc-country-card {
        padding: 20px 15px;
    }
    
    .pc-country-flag {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .pc-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .pc-countries-grid {
        grid-template-columns: 1fr;
    }
    
    .pc-form-section h3 {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .pc-calculator-container {
        max-width: 100%;
    }
    
    .pc-form-section,
    .pc-action-buttons,
    .pc-notice {
        display: none !important;
    }
    
    .pc-results-section {
        display: block !important;
        box-shadow: none;
    }
    
    .pc-chart-container,
    .pc-breakdown-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .pc-summary-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
