/* percentage-calculator.css */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --text: #1e293b;
    --text-light: #475569;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --transition: all 0.3s ease;
}

.dark-mode {
    --text: #f1f5f9;
    --text-light: #cbd5e1;
    --bg-light: #0f172a;
    --bg-card: #1e293b;
    --border: #334155;
}

.percentage-calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    color: var(--text);
    background-color: var(--bg-light);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.percentage-calculator-container h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.2;
}

.percentage-calculator-container .subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 800px;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

/* Features List */
.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.feature-item h3 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.5rem;
    color: var(--text);
}

.feature-item p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

/* Security Badge */
.security-badge {
    background: #f0f9ff;
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid #bae6fd;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.security-badge p {
    margin: 0;
    line-height: 1.6;
    color: #075985;
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2.5rem;
}

.calculation-type {
    margin-bottom: 1.5rem;
}

.calculation-type label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.calc-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-light);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.calc-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Input Sections */
.calc-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calc-section.active {
    display: block;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.input-group .input-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.input-small {
    width: 80px;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    text-align: right;
}

.input-large {
    width: 150px;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
}

#change-result, #discount-result {
    font-weight: 700;
    color: var(--primary);
}

/* Buttons */
.calculate-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    width: 100%;
    max-width: 300px;
}

.calculate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

/* Result Container */
.result-container {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: none;
}

.result-container.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.result-content {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    min-height: 1.5em;
}

.copy-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #f1f5f9;
}

/* Terminal Section */
.terminal {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2.5rem 0;
    font-family: 'Courier New', monospace;
}

.terminal > div:first-child {
    color: #fcd34d;
    margin-bottom: 0.75rem;
}

.command {
    color: #38bdf8;
    margin: 0.5rem 0;
    padding-left: 1rem;
}

.comment {
    color: #94a3b8;
    margin: 0.25rem 0 0.75rem 0;
    padding-left: 1rem;
    font-style: italic;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

td {
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

/* FAQ Section */
.faq-section {
    margin-top: 2rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-question {
    margin: 0;
    padding: 1rem;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item.active .faq-answer {
    padding: 1rem;
    max-height: 500px;
}

.faq-answer p {
    margin: 0 0 1rem;
    line-height: 1.6;
    color: var(--text-light);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .percentage-calculator-container {
        padding: 1.5rem 1rem;
    }
    
    .percentage-calculator-container h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .input-small, .input-large {
        width: 100%;
        max-width: 100%;
    }
    
    .calculator-card {
        padding: 1.25rem;
    }
    
    .calculation-type {
        margin-bottom: 1rem;
    }
    
    .calculate-btn {
        max-width: 100%;
    }
    
    .terminal {
        padding: 1rem;
    }
    
    .command, .comment {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .calculator-card, .calculator-card * {
        visibility: visible;
    }
    
    .calculator-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: none;
    }
    
    .calculate-btn, .copy-btn {
        display: none;
    }
}