:root {
    --bg-color: #f5f6f8;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-sec: #6b7280;
    --border-color: #e5e7eb;
    --red-text: #ef4444;
    --primary: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

.sticky-top {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 100;
    border-bottom: 1px solid #e5e7eb;
}

/* Header */
.top-nav-icons {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    padding: 20px 20px 5px;
    font-size: 20px;
}

.header {
    padding: 0 20px 25px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
}

/* Account Card */
.account-card {
    background: var(--card-bg);
    margin: 15px 10px;
    border-radius: 16px;
    padding: 25px 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.account-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.account-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
}

.account-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.tag {
    padding: 3px 6px;
    border-radius: 4px;
    background-color: #f3f4f6;
    color: var(--text-main);
    font-weight: 500;
}

.account-id {
    color: var(--text-sec);
    margin-left: 5px;
}

.balance-section {
    margin-bottom: 25px;
}

.balance {
    font-size: 24px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
    color: var(--text-main);
}

.action-btn:active .icon-circle {
    background-color: #e5e7eb;
}

.action-btn span {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 25px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    margin-top: 10px;
}

.tab {
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-sec);
    font-weight: 500;
    position: relative;
    cursor: pointer;
}

.tab.active {
    color: var(--text-main);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
}

/* History List */
.history-list {
    padding: 0 10px;
}

.history-date-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-sec);
    margin-bottom: 7px;
    padding: 0 12px;
    font-weight: 600;
}

.text-red {
    color: var(--red-text) !important;
}

.text-red-trade {
    color: #ef4444 !important;
}

.text-blue-trade {
    color: #0ea5e9 !important;
}

.trade-group-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 15px;
    overflow: hidden;
}

.trade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

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

.trade-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: -4px;
}

.trade-info-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-top,
.trade-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pair-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pair-name {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    white-space: nowrap;
}

.trade-tag {
    font-size: 13px;
    padding: 2px 5px;
    border-radius: 2px;
    font-weight: 500;
}

.tag-tp, .tag-grey {
    background-color: #f7f7f9;
    color: #4b5563;
}

.tag-sl, .tag-red {
    background-color: #fef2f2;
    color: #ef4444;
}

.tag-green {
    background-color: #ecfdf5;
    color: #10b981;
}

.trade-profit {
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
}

.trade-details {
    font-size: 13px;
    font-weight: 400;
    color: #333;
    white-space: nowrap;
}

.trade-close-price {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-sec);
    white-space: nowrap;
}

.history-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-sec);
    line-height: 1.5;
    margin-top: 15px;
    padding-bottom: 20px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 65px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.02);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #a1a1a1;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    flex: 1;
}

.nav-item i {
    font-size: 22px;
}

.nav-item.active {
    color: #1a1a1a;
    font-weight: 600;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    
    transition: opacity 0.2s;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    font-size: 26px;
    cursor: pointer;
    color: var(--text-sec);
    line-height: 1;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-sec);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
select.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #ececec;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    background-color: #ffffff;
    color: #111;
}

.form-group input:focus,
select.form-control:focus {
    border-color: #1a1a1a;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input[type="time"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 2;
}

.input-wrapper::after {
    content: '\f017';
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    position: absolute;
    right: 16px;
    color: #111;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.primary-btn:active {
    opacity: 0.8;
}

/* Add Trade Specifics */
.add-trade-content {
    max-height: 90vh;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .half {
    flex: 1;
}

select.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background-color: white;
    appearance: none;
}

.text-green {
    color: #10b981 !important;
}