/* Evil Kings Personal Finance Tracker - Dark Mode Styles */

:root {
    --primary-color: #FFB122;
    --secondary-color: #FFC738;
    --danger-color: #EC3200;
    --warning-color: #F24C00;
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --bg-card: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333;
    --success-color: #4ade80;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--danger-color), var(--warning-color));
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(236, 50, 0, 0.3);
}

.header-content h1 {
    font-size: 2.5em;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.king-icon {
    font-size: 1.2em;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* King Panel */
.king-panel {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.king-stats {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    gap: 25px;
    box-shadow: 0 4px 16px rgba(255, 177, 34, 0.2);
}

.king-avatar {
    text-align: center;
    min-width: 120px;
}

.king-icon-large {
    font-size: 5em;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.king-level {
    margin-top: 10px;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 177, 34, 0.5);
}

.king-info {
    flex: 1;
}

.king-info h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 177, 34, 0.1);
    border-radius: 8px;
}

.stat-row .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-row .value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
}

.xp-bar {
    position: relative;
    width: 300px;
    height: 30px;
    background: var(--bg-darker);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.xp-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
    width: 0%;
}

.xp-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.achievements-panel {
    background: var(--bg-card);
    border: 2px solid var(--secondary-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(255, 199, 56, 0.2);
}

.achievements-panel h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

#achievementsList {
    max-height: 200px;
    overflow-y: auto;
}

.achievement-item {
    background: rgba(255, 199, 56, 0.1);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-item.unlocked {
    border-left-color: var(--success-color);
}

.achievement-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.achievement-title {
    font-weight: bold;
    color: var(--primary-color);
}

.achievement-desc {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 15px 25px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    border-color: var(--primary-color);
    background: rgba(255, 177, 34, 0.1);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-darker);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 177, 34, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.summary-card .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 177, 34, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.summary-item .label {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-item .value {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-color);
}

.summary-item .value.income {
    color: var(--success-color);
}

.summary-item .value.expense {
    color: var(--danger-color);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group input,
.form-group select {
    padding: 12px;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 177, 34, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--bg-darker);
    box-shadow: 0 4px 16px rgba(255, 177, 34, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 177, 34, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--warning-color);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters input,
.filters select {
    flex: 1;
    padding: 10px;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Lists */
.transaction-item,
.budget-item,
.goal-item {
    background: rgba(255, 177, 34, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.transaction-item:hover,
.budget-item:hover,
.goal-item:hover {
    border-color: var(--primary-color);
    background: rgba(255, 177, 34, 0.1);
    transform: translateX(5px);
}

.transaction-item.income {
    border-left: 4px solid var(--success-color);
}

.transaction-item.expense {
    border-left: 4px solid var(--danger-color);
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.item-subtitle {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.item-amount {
    font-size: 1.3em;
    font-weight: bold;
    margin-right: 15px;
}

.item-amount.income {
    color: var(--success-color);
}

.item-amount.expense {
    color: var(--danger-color);
}

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

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 25px;
    background: var(--bg-darker);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    border: 2px solid var(--border-color);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.5s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 25px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

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

.budget-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.budget-name {
    font-weight: bold;
    color: var(--text-primary);
}

.budget-amounts {
    color: var(--text-secondary);
}

/* Goal Item */
.goal-progress {
    flex: 1;
    margin: 0 20px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: rgba(255, 177, 34, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-card.unlocked {
    border-color: var(--success-color);
    background: rgba(74, 222, 128, 0.1);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.achievement-card.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

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

.achievement-card .achievement-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.achievement-card .achievement-title {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.achievement-card .achievement-desc {
    font-size: 0.9em;
}

.achievement-card .unlocked-date {
    margin-top: 10px;
    font-size: 0.8em;
    color: var(--success-color);
    font-style: italic;
}

/* Canvas Charts */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .king-panel {
        grid-template-columns: 1fr;
    }

    .king-stats {
        flex-direction: column;
        text-align: center;
    }

    .xp-bar {
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        width: 100%;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.2em;
}
