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

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2rem;
}

section {
    background: var(--card-background);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

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

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.btn-secondary:hover {
    background-color: #0b7dda;
}

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

.btn-danger:hover {
    background-color: #da190b;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-right: 10px;
}

/* Card Styles */
.card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

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

.card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.card-balance {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-number {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: var(--card-background);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.barcode-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 5px;
}

.barcode-container svg,
.barcode-container canvas {
    max-width: 100%;
    height: auto;
}

.barcode-settings {
    background: #f0f8ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
}

.barcode-settings .form-group {
    margin-bottom: 0;
}

.barcode-format-select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.barcode-format-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.barcode-format-select:hover {
    border-color: var(--secondary-color);
}

/* Transaction Form */
.transaction-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.transaction-form h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Transaction History */
.transaction-history {
    margin-top: 30px;
}

.transaction-item {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid var(--danger-color);
    margin-bottom: 10px;
    border-radius: 5px;
}

.transaction-item.positive {
    border-left-color: var(--primary-color);
}

.transaction-date {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.transaction-amount {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.transaction-balance {
    font-size: 0.9rem;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.3rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-balance {
        margin-top: 10px;
    }

    .btn-small {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Utility Classes */
.mt-20 {
    margin-top: 20px;
}

.text-center {
    text-align: center;
}

.text-success {
    color: var(--primary-color);
}

.text-danger {
    color: var(--danger-color);
}
