/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 100%);
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Cursor Trail */
.cursor-trail-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999999;
}

.trail-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda 0%, #00b4d8 100%);
    box-shadow: 
        0 0 15px rgba(100, 255, 218, 0.8),
        0 0 30px rgba(100, 255, 218, 0.4);
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
    mix-blend-mode: screen;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Container */
.budget-container {
    min-height: 100vh;
    padding: 25px;
    position: relative;
}

/* Glass Effect */
.glass-effect {
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 25px 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.budget-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #64ffda, #4facfe, #667eea);
    opacity: 0.8;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #64ffda;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.2);
    transition: all 0.3s ease;
    width: fit-content;
}

.back-btn:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: translateX(-5px);
}

.budget-header h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #64ffda 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-subtitle {
    color: #cccccc;
    font-size: 0.95rem;
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.create-btn {
    background: linear-gradient(135deg, #64ffda 0%, #4facfe 100%);
    color: #0f0f23;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
}

.create-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.4);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.action-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.1);
    color: #64ffda;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-icon:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: rotate(15deg);
}

/* Budget Overview */
.budget-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 45px;
}

.overview-card {
    padding: 30px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease;
}

.overview-card:hover {
    transform: translateY(-5px);
}

.card-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(100, 255, 218, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overview-card:hover .card-wave {
    opacity: 1;
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    position: relative;
}

.card-icon.pulse::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 23px;
    border: 2px solid;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.total-budget .card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.spent-budget .card-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.remaining-budget .card-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.budget-health .card-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.card-content h3 {
    color: #cccccc;
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #64ffda 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.total-budget .card-value { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.spent-budget .card-value { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.remaining-budget .card-value { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.budget-health .card-value { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.progress-indicator {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #64ffda, #4facfe);
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    width: fit-content;
}

.trend-indicator.up {
    color: #43e97b;
}

.trend-text {
    font-size: 0.85rem;
}

.daily-budget {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    color: #4facfe;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.health-dot.healthy {
    background: #43e97b;
    box-shadow: 0 0 10px #43e97b;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #888888;
    opacity: 0.8;
}

/* Budget Categories */
.budget-categories {
    margin-bottom: 45px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title h2 {
    color: #ffffff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.section-subtitle {
    color: #cccccc;
    font-size: 0.9rem;
    opacity: 0.8;
}

.filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.search-box i {
    color: #64ffda;
}

.search-box input {
    background: none;
    border: none;
    color: #ffffff;
    width: 200px;
    outline: none;
}

.filter-select {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(100, 255, 218, 0.2);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #64ffda;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 25px;
}

.budget-item {
    padding: 25px;
    border-radius: 18px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.budget-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.budget-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.budget-category {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.budget-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.1);
    color: #64ffda;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: scale(1.1);
}

.budget-progress {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.spent-amount {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
}

.budget-limit {
    color: #888888;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.safe {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ffa726 0%, #ffcc02 100%);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #ef5350 0%, #f18a8a 100%);
}

.budget-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-badge.safe {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.2), rgba(56, 249, 215, 0.2));
    color: #43e97b;
    border: 1px solid rgba(67, 233, 123, 0.3);
}

.status-badge.warning {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.2), rgba(255, 204, 2, 0.2));
    color: #ffa726;
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.status-badge.danger {
    background: linear-gradient(135deg, rgba(239, 83, 80, 0.2), rgba(241, 138, 138, 0.2));
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.3);
}

.percentage {
    color: #cccccc;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Budget Analytics */
.budget-analytics {
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.analytics-title h2 {
    color: #ffffff;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.analytics-subtitle {
    color: #cccccc;
    font-size: 0.9rem;
    opacity: 0.8;
}

.period-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.1);
    color: #64ffda;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: rotate(180deg);
}

.analytics-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 35px;
}

.chart-section {
    position: relative;
    height: 320px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h4 {
    color: #ffffff;
    font-size: 1.1rem;
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #cccccc;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.insights-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.insights-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-count {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.insight-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-left: 4px solid #64ffda;
    transition: all 0.3s ease;
}

.insight-item:hover {
    background: rgba(100, 255, 218, 0.05);
    transform: translateX(5px);
}

.insight-text {
    color: #cccccc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.view-all-insights {
    width: 100%;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: #64ffda;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.view-all-insights:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(100, 255, 218, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    position: relative;
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #64ffda 0%, #4facfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #0f0f23;
}

.modal-title h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.modal-title p {
    color: #cccccc;
    font-size: 0.9rem;
    opacity: 0.8;
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.1);
    color: #888888;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
    transform: rotate(90deg);
}

.budget-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #cccccc;
    margin-bottom: 12px;
    font-weight: 500;
    gap: 10px;
}

.form-group label i {
    color: #64ffda;
    opacity: 0.8;
}

.threshold-value {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-with-icon {
    position: relative;
}

.input-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64ffda;
    font-weight: 600;
}

.input-with-icon input {
    padding-left: 35px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.05);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

input[type="range"] {
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda 0%, #4facfe 100%);
    cursor: pointer;
    border: 3px solid #0f0f23;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #888888;
}

.form-group small {
    color: #888888;
    font-size: 0.85rem;
    margin-top: 8px;
    display: block;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cccccc;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cancel:hover {
    background: rgba(239, 83, 80, 0.1);
    color: #ef5350;
    border-color: rgba(239, 83, 80, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #64ffda 0%, #4facfe 100%);
    color: #0f0f23;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.4);
}

/* Responsive */
@media (max-width: 1200px) {
    .budget-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 992px) {
    .analytics-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .chart-section {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .budget-container {
        padding: 15px;
    }
    
    .budget-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }
    
    .header-left {
        align-items: center;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .budget-overview {
        grid-template-columns: 1fr;
    }
    
    .budget-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .budget-header h1 {
        font-size: 1.6rem;
    }
    
    .create-btn {
        padding: 12px 20px;
    }
    
    .overview-card {
        padding: 20px;
    }
    
    .card-value {
        font-size: 1.8rem;
    }
}