/* flamexyz - Base Styles */
:root {
    /* Light Theme */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3f37c9;
    --secondary: #4cc9f0;
    --accent: #f72585;
    --background: #f8f9fa;
    --surface: #ffffff;
    --error: #ef233c;
    --success: #2ecc71;
    --warning: #ff9f1c;
    --text-primary: #2b2d42;
    --text-secondary: #8d99ae;
    --border: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

/* flamexyz - Dark Theme */
[data-theme="dark"] {
    --primary: #7e57c2;
    --primary-light: #9575cd;
    --primary-dark: #5e35b1;
    --secondary: #26a69a;
    --accent: #ff7043;
    --background: #121212;
    --surface: #1e1e1e;
    --error: #f44336;
    --success: #66bb6a;
    --warning: #ffca28;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border: #424242;
}

/* flamexyz - Base Elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fAZ9hiA.woff2) format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url(https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format('woff2');
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* flamexyz - App Container */
#app {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
}

/* flamexyz - Theme Toggle */
.theme-toggle-container {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 100;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* flamexyz - Header */
.app-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-xl);
    position: relative;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.app-logo-icon {
    color: var(--primary);
    font-size: 24px;
}

.app-logo-text {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* flamexyz - Tabs */
.tabs-container {
    display: flex;
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.tab {
    flex: 1;
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tab.active {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* flamexyz - Content Container */
.content-container {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s ease;
}

/* flamexyz - Item Display */
.item-display {
    margin-bottom: var(--space-lg);
}

.item-image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: var(--background);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.item-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--surface);
}

.item-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: var(--space-sm);
}

.item-image-placeholder i {
    font-size: 32px;
    margin-bottom: var(--space-xs);
    color: var(--primary-light);
}

.item-info {
    width: 100%;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.item-target {
    font-size: 14px;
    color: var(--text-secondary);
}

/* flamexyz - Balance Section */
.balance-section {
    margin-bottom: var(--space-lg);
}

.balance-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.balance-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.balance-amount {
    font-size: 20px;
    font-weight: 600;
    word-break: break-word;
}

.current-balance {
    color: var(--primary);
}

.remaining-balance.positive {
    color: var(--success);
}

.remaining-balance.negative {
    color: var(--warning);
}

/* flamexyz - Progress Section */
.progress-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.progress-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.progress-circle {
    width: 100%;
    height: 100%;
}

.progress-circle circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-bg {
    stroke: var(--border);
}

.progress-bar {
    stroke: var(--primary);
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-xs);
}

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* flamexyz - Anime Character */
.anime-character {
    width: 100px;
    height: 100px;
    background-image: url('https://i.pinimg.com/originals/0f/4f/53/0f4f53c7a8e0e1579b6b2b8e4a9c1b2a.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: float 3s ease-in-out infinite;
}

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

/* flamexyz - History Section */
.history-section {
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    flex: 1;
}

.history-notes {
    font-weight: 500;
    color: var(--text-primary);
}

.history-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.history-amount {
    font-weight: 600;
    color: var(--success);
}

.empty-history {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-secondary);
}

.empty-history i {
    font-size: 32px;
    margin-bottom: var(--space-md);
    color: var(--border);
}

/* flamexyz - Form Elements */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: var(--surface);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    gap: var(--space-sm);
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn i {
    font-size: 16px;
}

.file-upload {
    display: none;
}

.file-upload-label {
    display: block;
    padding: 12px;
    background-color: var(--primary-light);
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-md);
    font-size: 14px;
    font-weight: 500;
}

.file-upload-label:hover {
    background-color: var(--primary);
}

/* flamexyz - Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.social-link {
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* flamexyz - Achievement Badge */
.achievement-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    animation: pulse 1.5s infinite;
}

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

/* flamexyz - Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 3px;
}

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

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

/* flamexyz - Page Transitions */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* flamexyz - Responsive adjustments */
@media (max-width: 400px) {
    #app {
        padding: var(--space-md);
    }
    
    .progress-section {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }
    
    .anime-character {
        margin-top: var(--space-md);
    }
}