* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-shapes {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.loader-shape {
    width: 48px;
    height: 48px;
}

.loader-shape svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #c9a227;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Circle Animation */
.loader-shape.circle svg circle {
    stroke-dasharray: 201;
    stroke-dashoffset: 0;
    animation: circleAnim 2s ease-in-out infinite;
}

@keyframes circleAnim {
    0% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 201; }
    100% { stroke-dashoffset: 0; }
}

/* Triangle Animation */
.loader-shape.triangle svg polygon {
    stroke-dasharray: 180;
    stroke-dashoffset: 0;
    animation: triangleAnim 2s ease-in-out infinite 0.2s;
}

@keyframes triangleAnim {
    0% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 180; }
    100% { stroke-dashoffset: 0; }
}

/* Square Animation */
.loader-shape.square svg rect {
    stroke-dasharray: 256;
    stroke-dashoffset: 0;
    animation: squareAnim 2s ease-in-out infinite 0.4s;
}

@keyframes squareAnim {
    0% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 256; }
    100% { stroke-dashoffset: 0; }
}

.loader-text {
    color: #c9a227;
    font-size: 1rem;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

:root {
    --primary: rgba(15, 15, 25, 0.95);
    --secondary: rgba(20, 20, 35, 0.9);
    --accent: #c9a227;
    --income: #c9a227;
    --expense: #e74c3c;
    --text: #f5f5f5;
    --text-muted: #b8b8b8;
    --card-bg: rgba(25, 25, 40, 0.85);
    --border: rgba(201, 162, 39, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a12;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.5) 100%),
                url('dubai-bg.jpg') center/cover no-repeat;
    z-index: -1;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Bakiye Kartı */
.balance-card {
    background: rgba(20, 20, 35, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
}

.balance-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.balance-amount {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(90deg, #c9a227, #f4d03f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balance-amount.negative {
    background: linear-gradient(90deg, var(--expense), #ff9a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Özet Bölümü */
.summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: rgba(20, 20, 35, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.summary-amount {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 600;
}

.income .summary-amount {
    color: var(--income);
}

.expense .summary-amount {
    color: var(--expense);
}

/* Form Bölümü */
.form-section {
    background: rgba(20, 20, 35, 0.95);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.form-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--primary);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--income);
    box-shadow: 0 0 0 3px rgba(0, 208, 156, 0.2);
}

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label input {
    display: none;
}

.radio-label span {
    font-weight: 500;
}

.income-radio:has(input:checked) {
    border-color: var(--income);
    background: rgba(0, 208, 156, 0.15);
}

.income-radio:has(input:checked) span {
    color: var(--income);
}

.expense-radio:has(input:checked) {
    border-color: var(--expense);
    background: rgba(255, 107, 107, 0.15);
}

.expense-radio:has(input:checked) span {
    color: var(--expense);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #c9a227, #f4d03f);
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.5);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-text {
    opacity: 0.7;
}

.btn-submit.loading .btn-spinner {
    display: block;
}

.btn-submit.loading {
    pointer-events: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Veri Aksiyonları */
.data-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-action {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-action:hover {
    border-color: var(--income);
    background: rgba(0, 208, 156, 0.1);
}

.btn-import {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* İşlem Geçmişi */
.history-section {
    background: rgba(20, 20, 35, 0.95);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.history-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: var(--income);
    color: var(--text);
}

.filter-btn.active {
    background: var(--income);
    border-color: var(--income);
    color: var(--primary);
}

.filter-btn[data-filter="expense"].active {
    background: var(--expense);
    border-color: var(--expense);
}

/* Tarih Filtresi */
.date-filter {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-input-group {
    flex: 1;
    min-width: 120px;
}

.date-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.date-input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--primary);
    color: var(--text);
    font-size: 0.9rem;
}

.date-input-group input:focus {
    outline: none;
    border-color: var(--income);
}

.btn-clear-date {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear-date:hover {
    border-color: var(--expense);
    color: var(--expense);
}

.transaction-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.transaction-list::-webkit-scrollbar {
    width: 6px;
}

.transaction-list::-webkit-scrollbar-track {
    background: var(--primary);
    border-radius: 3px;
}

.transaction-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--primary);
    border-radius: 12px;
    margin-bottom: 10px;
    border-left: 4px solid;
    transition: transform 0.2s;
}

.transaction-item:hover {
    transform: translateX(5px);
}

.transaction-item.income {
    border-left-color: var(--income);
}

.transaction-item.expense {
    border-left-color: var(--expense);
}

.transaction-info {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}

.transaction-desc {
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-word;
    line-height: 1.4;
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: 15px;
    white-space: nowrap;
}

.transaction-item.income .transaction-amount {
    color: var(--income);
}

.transaction-item.expense .transaction-amount {
    color: var(--expense);
}

.transaction-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    margin-left: 10px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.transaction-delete:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--expense);
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
}

.empty-message.hidden {
    display: none;
}

/* Daha Fazla Yükle */
.btn-load-more {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:hover {
    border-color: var(--income);
    color: var(--income);
}

.btn-load-more.hidden {
    display: none;
}

.load-info {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.load-info.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 20px 0;
    }

    .balance-card {
        padding: 25px 20px;
    }

    .summary-item {
        padding: 15px;
    }

    .form-section,
    .history-section {
        padding: 20px;
    }

    .transaction-item {
        padding: 12px;
        flex-wrap: wrap;
    }

    .transaction-info {
        width: calc(100% - 80px);
    }

    .transaction-amount {
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .radio-group {
        flex-direction: column;
    }

    .summary {
        grid-template-columns: 1fr;
    }
}

