body {
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
}

#app-container {
    padding: 40px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #2c3e50;
    line-height: 1.5;
}

.main-title {
    font-weight: 600;
    border-bottom: 2px solid #34495e;
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.error-banner {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 30px;
    font-weight: bold;
}

.card {
    margin-bottom: 40px;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.card-title {
    margin-top: 0;
    color: #7f8c8d;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flex-row {
    display: flex;
    gap: 30px;
}

.flex-1 {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.85em;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table thead tr {
    border-bottom: 2px solid #eee;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 8px;
}

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

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

.font-mono {
    font-family: monospace;
}

.transaction-form {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 0.5fr;
    gap: 10px;
    align-items: end;
    background: #fdfdfd;
    padding: 15px;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

.form-input-small {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.form-label-small {
    display: block;
    font-size: 0.75em;
    margin-bottom: 3px;
}

.btn-primary {
    width: 100%;
    padding: 9px;
    background: #34495e;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

.grid-4-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
}

#summary-card {
    margin-top: 50px;
    padding: 30px;
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#summary-card h2 {
    margin-top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    font-weight: 300;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.summary-item-label {
    font-size: 0.85em;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.summary-item-value {
    font-size: 2.5em;
    font-weight: 700;
}

.summary-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    opacity: 0.8;
}

.tr-transaction {
    border-bottom: 1px solid #f0f0f0;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.badge-buy {
    background: #d5f5e3;
    color: #1d8348;
}

.badge-sell {
    background: #fadbd8;
    color: #943126;
}

.btn-delete {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    #app-container {
        padding: 20px 15px;
    }
    
    .main-title {
        font-size: 1.8em;
        margin-bottom: 30px;
        padding-bottom: 10px;
    }
    
    .card {
        padding: 20px 15px;
        margin-bottom: 30px;
    }
    
    .flex-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .transaction-form {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .grid-4-cols {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .summary-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .summary-item-value {
        font-size: 2em;
    }
    
    #summary-card {
        padding: 25px 20px;
    }
    
    .form-input, .form-input-small {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary {
        padding: 12px;
        font-size: 16px;
        min-height: 44px; /* Touch target minimum */
    }
    
    .btn-delete {
        min-height: 44px;
        min-width: 44px;
        font-size: 1.4em;
    }
    
    /* Make table horizontally scrollable on mobile */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        margin-bottom: 15px;
    }
    
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
    }
    
    .data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .data-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
        background: white;
    }
    
    .data-table td {
        border: none;
        position: relative;
        padding: 8px 8px 8px 25%;
        text-align: left !important;
    }
    
    .data-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 20%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #7f8c8d;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    #app-container {
        padding: 15px 10px;
    }
    
    .card {
        padding: 15px 10px;
        border-radius: 4px;
    }
    
    .summary-item-value {
        font-size: 1.8em;
    }
    
    .card-title {
        font-size: 0.8em;
    }
}

