/* Modern Professional Finance Tracker Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --dark-text: #f1f5f9;
    --dark-text-secondary: #94a3b8;
    --light-bg: #f8fafc;
    --light-card: #ffffff;
    --light-text: #0f172a;
    --light-text-secondary: #64748b;
    --border-radius: 12px;
    --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 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--dark-bg);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Typography */
.container h1,
main h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container h2,
main h2,
section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--dark-text);
}

.container h3,
main h3,
section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--dark-text);
}

.description {
    color: var(--dark-text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

/* File Operations Section */
.file-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    background: var(--dark-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.file-operations label {
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-operations input[type="file"] {
    padding: 0.5rem 1rem;
    background: var(--dark-bg);
    color: var(--dark-text);
    border: 2px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.file-operations input[type="file"]:hover {
    border-color: var(--primary-color);
}

/* Summary and Charts Container */
.summary-charts-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    color: white;
}

.summary-section h2 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.summary-section p {
    margin: 1rem 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.summary-section span {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.chart {
    background: var(--dark-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.chart:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.chart h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dark-text-secondary);
}

/* Bills and Income Sections */
.flex-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

section {
    background: var(--dark-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

section:hover {
    box-shadow: var(--shadow-lg);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

label {
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    padding: 0.75rem 1rem;
    border: 2px solid #334155;
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--dark-text);
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
button {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

/* Only uppercase for content buttons, not header */
.container button,
main button,
section button,
form button {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: translateY(0);
}

/* Lists */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

li {
    padding: 1rem;
    background: var(--dark-bg);
    border: 1px solid #334155;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--dark-text);
    transition: var(--transition);
}

li:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

li button {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

li button:first-of-type {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}

li button:last-of-type {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    color: #0f172a;
    animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
    color: #0f172a;
    margin-top: 0;
}

.close {
    color: #94a3b8;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    transition: var(--transition);
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--danger-color);
    transform: scale(1.1);
}

.edit-form input,
.edit-form button {
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .charts-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 968px) {
    .summary-charts-container {
        grid-template-columns: 1fr;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart:last-child {
        grid-column: span 1;
    }

    .flex-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .file-operations {
        flex-direction: column;
        align-items: stretch;
    }

    .file-operations label {
        margin-top: 1rem;
    }

    .file-operations label:first-child {
        margin-top: 0;
    }
}

/* Light Mode Styles */
[data-theme="light"] body {
    background: var(--light-bg);
    color: var(--light-text);
}

[data-theme="light"] .container {
    background: transparent;
}

[data-theme="light"] .container h1,
[data-theme="light"] main h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .container h2,
[data-theme="light"] main h2,
[data-theme="light"] section h2,
[data-theme="light"] .container h3,
[data-theme="light"] main h3,
[data-theme="light"] section h3 {
    color: var(--light-text);
}

[data-theme="light"] .description {
    color: var(--light-text-secondary);
}

[data-theme="light"] .file-operations {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .file-operations label {
    color: var(--light-text);
}

[data-theme="light"] .file-operations input[type="file"] {
    background: var(--light-bg);
    color: var(--light-text);
    border-color: #e2e8f0;
}

[data-theme="light"] .summary-section {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
}

[data-theme="light"] .chart {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chart h3 {
    color: var(--light-text-secondary);
}

[data-theme="light"] section {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] label {
    color: var(--light-text);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"] {
    background: var(--light-bg);
    color: var(--light-text);
    border-color: #e2e8f0;
}

[data-theme="light"] li {
    background: var(--light-bg);
    border-color: #e2e8f0;
    color: var(--light-text);
}

[data-theme="light"] li:hover {
    border-color: var(--primary-color);
}

[data-theme="light"] .modal-content {
    color: var(--light-text);
}
