/* SCOPED STYLES - apply only inside `.budget_calci`
   These duplicate the main visual rules but are
   prefixed so they won't affect the rest of the page.
   Place an element like `<div class="budget_calci">...</div>`
   around the calculator to enable these styles.
*/

.budget_calci .container {
    max-width: 1200px;
    margin: 0 auto;
}

.budget_calci .header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    animation: slideInDown 0.6s ease;
}

.budget_calci .header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.budget_calci .header p {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.budget_calci .header-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 400;
}

.budget_calci .section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease;
}

.budget_calci .section:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 12px 40px rgba(96, 165, 250, 0.1);
    transform: translateY(-2px);
}

.budget_calci .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.budget_calci .template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.budget_calci .form-group {
    display: flex;
    flex-direction: column;
}

.budget_calci .form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget_calci .form-group select,
.budget_calci .form-group input {
    background: rgba(51, 65, 85, 0.8);
    border: 2px solid rgba(71, 85, 105, 0.5);
    color: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.budget_calci .form-group input::placeholder {
    color: #64748b;
}

.budget_calci .form-group select:focus,
.budget_calci .form-group input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(30, 58, 138, 0.3);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
}

.budget_calci .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.budget_calci .btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #06b6d4 100%);
    color: #fff;
    width: 100%;
    font-size: 1.05rem;
    padding: 16px;
    box-shadow: 0 8px 16px rgba(96, 165, 250, 0.3);
}

.budget_calci .btn-secondary {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 2px solid #60a5fa;
}

.budget_calci .items-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 25px;
}

.budget_calci .items-list::-webkit-scrollbar {
    width: 8px;
}

.budget_calci .items-list::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
}

.budget_calci .items-list::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.budget_calci .budget-item {
    display: grid;
    grid-template-columns: 1fr 140px 120px auto;
    gap: 15px;
    align-items: center;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.4) 0%, rgba(30, 41, 59, 0.6) 100%);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.budget_calci .budget-item input {
    border: 2px solid rgba(71, 85, 105, 0.5);
    color: #fff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.budget_calci .amount-display {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 2px solid rgba(96, 165, 250, 0.4);
    padding: 12px 14px;
    border-radius: 8px;
    text-align: right;
    font-weight: 700;
    color: #60a5fa;
    font-size: 0.95rem;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.budget_calci .add-category-section {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.3) 0%, rgba(30, 41, 59, 0.5) 100%);
    border: 2px dashed rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.budget_calci .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.budget_calci .summary-card {
    padding: 30px;
    border-radius: 15px;
    border: 2px solid;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: popIn 0.5s ease;
}

.budget_calci .summary-card.total { background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0.05) 100%); border-color: #60a5fa; }
.budget_calci .summary-card.categories { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%); border-color: #10b981; }
.budget_calci .summary-card.average { background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%); border-color: #a855f7; }
.budget_calci .summary-card.breakdown { background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%); border-color: #f59e0b; }

.budget_calci .summary-label { color: #94a3b8; font-size: 0.9rem; margin-bottom: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.budget_calci .summary-value { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; line-height: 1; }

.budget_calci .progress-container { margin-top: 12px; }
.budget_calci .progress-bar { width: 100%; height: 8px; background: rgba(30, 41, 59, 0.8); border-radius: 10px; overflow: hidden; border: 1px solid rgba(71, 85, 105, 0.5); }
.budget_calci .progress-fill { height: 100%; background: linear-gradient(90deg, #60a5fa 0%, #06b6d4 100%); border-radius: 10px; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 15px rgba(96, 165, 250, 0.5); position: relative; }

.budget_calci .breakdown-table { width: 100%; border-collapse: collapse; background: rgba(30, 41, 59, 0.5); border-radius: 12px; overflow: hidden; border: 1px solid rgba(71, 85, 105, 0.5); margin-top: 20px; }
.budget_calci .breakdown-table thead { background: linear-gradient(135deg, rgba(96, 165, 250, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%); border-bottom: 2px solid rgba(96, 165, 250, 0.3); }
.budget_calci .breakdown-table th { padding: 18px 20px; text-align: left; font-weight: 700; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.9rem; }
.budget_calci .breakdown-table td { padding: 16px 20px; border-bottom: 1px solid rgba(71, 85, 105, 0.3); font-size: 0.95rem; }

.budget_calci .alert { padding: 16px 20px; border-radius: 10px; margin-bottom: 25px; display: none; font-weight: 600; border-left: 4px solid; animation: slideDown 0.3s ease; }
.budget_calci .alert.show { display: block; }
.budget_calci .alert.success { background: rgba(16, 185, 129, 0.15); border-color: #10b981; color: #86efac; }
.budget_calci .alert.error { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; color: #fca5a5; }
.budget_calci .alert.info { background: rgba(96, 165, 250, 0.15); border-color: #60a5fa; color: #93c5fd; }

.budget_calci .empty-state { text-align: center; padding: 60px 20px; color: #64748b; }
.budget_calci .empty-state-icon { font-size: 3rem; margin-bottom: 15px; display: block; animation: bounce 2s infinite; }
.budget_calci .empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; color: #cbd5e1; }

.budget_calci .footer { text-align: center; padding: 30px 20px; color: #64748b; border-top: 1px solid rgba(71, 85, 105, 0.3); margin-top: 50px; font-size: 0.9rem; }

.budget_calci .quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(71, 85, 105, 0.3); }
.budget_calci .quick-actions button { flex: 1; min-width: 120px; }

@media (max-width: 768px) {
    .budget_calci .header h1 { font-size: 2rem; }
    .budget_calci .header p { font-size: 1rem; }
    .budget_calci .section { padding: 20px; }
    .budget_calci .section-title { font-size: 1.3rem; }
    .budget_calci .add-category-grid { grid-template-columns: 1fr; }
    .budget_calci .budget-item { grid-template-columns: 1fr; gap: 12px; }
    .budget_calci .template-grid { grid-template-columns: 1fr; }
    .budget_calci .summary-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
    .budget_calci .header h1 { font-size:1.5rem; margin-bottom: 10px; }
    .budget_calci .header p { font-size: 0.9rem; }
    .budget_calci .section { padding: 15px; margin-bottom: 20px; border-radius: 12px; }
    .budget_calci .section-title { font-size: 1.1rem; margin-bottom: 15px; }
    .budget_calci .template-grid { gap: 12px; margin-bottom: 15px; }
    .budget_calci .form-group label { font-size: 0.85rem; }
    .budget_calci .form-group select, .budget_calci .form-group input { padding: 12px 14px; font-size: 0.95rem; }
    .budget_calci .btn { padding: 12px 20px; font-size: 0.9rem; }
}
