:root {
    --mobile-calendar-size: 40px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 50%, #1a252f 100%);
    color: #ecf0f1;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Mobile Safari */
    position: relative;
    overflow-x: hidden;
    /* Handle mobile safe areas */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #ecf0f1;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #bdc3c7;
    font-size: 1.1rem;
    font-weight: 400;
}

.tabs {
    display: flex;
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 30px;
    overflow-x: auto;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
}

.tabs::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 15px 15px 0 0;
    pointer-events: none;
}

.tab {
    background: transparent;
    border: none;
    color: #bdc3c7;
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #ecf0f1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.tab.active {
    background: linear-gradient(145deg, #27ae60 0%, #2ecc71 50%, #27ae60 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-content {
    display: none;
    background: linear-gradient(145deg, rgba(44, 62, 80, 0.95) 0%, rgba(52, 73, 94, 0.9) 100%);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.tab-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.tab-content::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.tab-content.active {
    display: block;
}

/* Profile Tab Styles */
.profile-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.profile-form, .profile-stats {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.profile-form::before, .profile-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #ecf0f1;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"], input[type="number"], input[type="range"], select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.8) 0%, rgba(44, 62, 80, 0.9) 100%);
    color: #ecf0f1;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

input[type="range"] {
    padding: 8px 0;
    background: transparent;
    appearance: none;
}

input[type="range"]::-webkit-slider-track {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.8) 0%, rgba(44, 62, 80, 0.9) 100%);
    height: 6px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ecf0f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select option {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 8px 12px;
}

input[type="text"]:focus, input[type="number"]:focus, input[type="range"]:focus, select:focus {
    outline: none;
    border-color: #27ae60;
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 1) 100%);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2),
                inset 0 2px 5px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 4px 15px rgba(39, 174, 96, 0.1);
}

.btn {
    background: linear-gradient(145deg, #27ae60 0%, #2ecc71 50%, #27ae60 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 10px 10px 0 0;
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #2ecc71 0%, #27ae60 50%, #2ecc71 100%);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 50%, #e74c3c 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #c0392b 0%, #e74c3c 50%, #c0392b 100%);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.btn-warning {
    background: linear-gradient(145deg, #f39c12 0%, #e67e22 50%, #f39c12 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.btn-warning:hover {
    background: linear-gradient(145deg, #e67e22 0%, #f39c12 50%, #e67e22 100%);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #bdc3c7;
    font-weight: 500;
}

.stat-value {
    color: #ecf0f1;
    font-weight: 600;
    font-size: 1.1rem;
}

.profit { color: #2ecc71; }
.loss { color: #e74c3c; }

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ecf0f1;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.calendar-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 10px 10px 0 0;
    pointer-events: none;
}

.calendar-nav:hover {
    background: linear-gradient(145deg, #27ae60 0%, #2ecc71 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.calendar-nav-arrow {
    display: none;
}

.calendar-month {
    color: #ecf0f1;
    font-size: 1.5rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: rgba(52, 73, 94, 0.6);
    padding: 20px;
    border-radius: 12px;
}

.calendar-day-header {
    text-align: center;
    padding: 12px;
    color: #bdc3c7;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    background: rgba(44, 62, 80, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 8px;
    position: relative;
}

.calendar-day:hover {
    background: rgba(52, 73, 94, 1);
    border-color: #27ae60;
    transform: translateY(-2px);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background: #27ae60;
    color: #ffffff;
    font-weight: 600;
    border-color: #27ae60;
}

.day-number {
    font-weight: 600;
    margin-bottom: 4px;
    color: #ecf0f1;
}

.calendar-day.today .day-number {
    color: #ffffff;
}

.day-pnl {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

.day-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.day-indicator.profit {
    background: #2ecc71;
}

.day-indicator.loss {
    background: #e74c3c;
}

/* Chart Styles */
.chart-container {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

/* PnL Entry Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(34, 45, 58, 0.95) 0%, rgba(44, 62, 80, 0.9) 100%);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 400px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    color: #ecf0f1;
    backdrop-filter: blur(25px);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.modal h3 {
    color: #ecf0f1;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #bdc3c7;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

.import-export {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.file-input {
    display: none;
}

.file-label {
    background: linear-gradient(145deg, #f39c12 0%, #e67e22 50%, #f39c12 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.file-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 10px 10px 0 0;
    pointer-events: none;
}

.file-label:hover {
    background: linear-gradient(145deg, #e67e22 0%, #f39c12 50%, #e67e22 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

h3 {
    color: #ecf0f1;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Account History Table */
.history-section {
    margin-top: 30px;
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.history-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-table th {
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.8) 0%, rgba(46, 204, 113, 0.6) 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table th:first-child {
    border-radius: 10px 0 0 0;
}

.history-table th:last-child {
    border-radius: 0 10px 0 0;
}

.history-table td {
    color: #ecf0f1;
    font-weight: 500;
}

.history-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-table .profit-month {
    color: #2ecc71;
    font-weight: 600;
}

.history-table .loss-month {
    color: #e74c3c;
    font-weight: 600;
}

/* Discipline Tab Styles */
.discipline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.discipline-card {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 25px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.discipline-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.status-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.status-card {
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
    border-radius: 15px 15px 0 0;
    pointer-events: none;
}

.status-card.warning {
    border-color: #f39c12;
    background: linear-gradient(145deg, rgba(243, 156, 18, 0.2) 0%, rgba(230, 126, 34, 0.1) 100%);
}

.status-card.danger {
    border-color: #e74c3c;
    background: linear-gradient(145deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.1) 100%);
}

.status-card.safe {
    border-color: #27ae60;
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.2) 0%, rgba(46, 204, 113, 0.1) 100%);
}

.status-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ecf0f1;
}

.status-label {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.emotional-state {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.emotion-btn {
    padding: 15px 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(145deg, rgba(52, 73, 94, 0.8) 0%, rgba(44, 62, 80, 0.9) 100%);
    color: #ecf0f1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.emotion-btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-color: #27ae60;
}

.emotion-btn.active {
    border-color: #27ae60;
    background: linear-gradient(145deg, rgba(39, 174, 96, 0.3) 0%, rgba(46, 204, 113, 0.2) 100%);
    color: #2ecc71;
}

.emotion-btn.negative {
    border-color: #e74c3c;
    background: linear-gradient(145deg, rgba(231, 76, 60, 0.3) 0%, rgba(192, 57, 43, 0.2) 100%);
    color: #e74c3c;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.progress-safe {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.progress-warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.progress-danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.rules-list {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rule-item:last-child {
    border-bottom: none;
}

.rule-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 10px;
}

.rule-status.ok {
    background: #27ae60;
}

.rule-status.warning {
    background: #f39c12;
}

.rule-status.violated {
    background: #e74c3c;
}

.alert-banner {
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    animation: pulse 2s infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-banner.show {
    display: block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.cooldown-timer {
    text-align: center;
    padding: 30px;
    border: 2px dashed #f39c12;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(243, 156, 18, 0.2) 0%, rgba(230, 126, 34, 0.1) 100%);
    margin-bottom: 20px;
    display: none;
}

.cooldown-timer.active {
    display: block;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 10px;
}

.emotion-display {
    text-align: center;
    margin-top: 10px;
    font-size: 1.1rem;
    color: #bdc3c7;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .profile-section, .discipline-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
    }

    .status-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .emotional-state {
        grid-template-columns: repeat(3, 1fr);
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 6px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex: 0 0 auto;
        min-width: 80px;
        white-space: nowrap;
        border-radius: 8px;
    }

    .tab-content {
        padding: 15px;
        border-radius: 16px;
    }

    /* Mobile Calendar Styles */
    .calendar-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
        padding: 0 5px;
    }

    .calendar-nav {
        display: none;
    }

    .calendar-nav-arrow {
        display: flex;
        background: linear-gradient(145deg, rgba(52, 73, 94, 0.9) 0%, rgba(44, 62, 80, 0.8) 100%);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ecf0f1;
        padding: 8px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1rem;
        font-weight: 600;
        transition: all 0.3s ease;
        backdrop-filter: blur(15px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2),
                    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
        min-width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .calendar-nav-arrow:hover,
    .calendar-nav-arrow:active {
        background: linear-gradient(145deg, #27ae60 0%, #2ecc71 100%);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
    }

    .calendar-month {
        font-size: 1rem;
        text-align: center;
        flex: 1;
        min-width: 0; /* Allow text to shrink */
        word-wrap: break-word;
    }

    /* Mobile Calendar Grid with dynamic sizing */
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 2px; /* Smaller gap for mobile */
        background: rgba(52, 73, 94, 0.6);
        padding: 10px;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        /* Ensure grid fits viewport */
        box-sizing: border-box;
    }

    .calendar-day-header {
        text-align: center;
        padding: 8px 2px;
        color: #bdc3c7;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        height: var(--mobile-calendar-size, 35px);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .calendar-day {
        background: rgba(44, 62, 80, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 2px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
        min-height: var(--mobile-calendar-size, 40px);
        max-height: var(--mobile-calendar-size, 40px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 6px;
        position: relative;
        font-size: 0.8rem;
        /* Ensure proper touch target size */
        -webkit-tap-highlight-color: rgba(39, 174, 96, 0.3);
        touch-action: manipulation;
        /* Prevent text selection on touch */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Force hardware acceleration for smooth animations */
        will-change: transform;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .calendar-day:hover,
    .calendar-day:focus {
        background: rgba(52, 73, 94, 1);
        border-color: #27ae60;
        transform: translateY(-1px);
        outline: none;
        box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
    }

    .calendar-day:active {
        transform: scale(0.95);
    }

    .calendar-day.other-month {
        opacity: 0.2;
        pointer-events: none;
    }

    .calendar-day.today {
        background: #27ae60;
        color: #ffffff;
        font-weight: 600;
        border-color: #27ae60;
        box-shadow: 0 2px 10px rgba(39, 174, 96, 0.4);
    }

    .day-number {
        font-weight: 600;
        color: #ecf0f1;
        line-height: 1;
    }

    .calendar-day.today .day-number {
        color: #ffffff;
    }

    /* Hide P/L text on very small screens but keep color indicators */
    .day-pnl {
        display: none;
    }

    .day-indicator {
        display: none;
    }

    .modal-content {
        width: calc(100vw - 20px);
        max-width: 400px;
        margin: 10px;
        padding: 20px;
        border-radius: 16px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .import-export {
        flex-direction: column;
        gap: 12px;
    }

    .file-label {
        width: 100%;
        text-align: center;
        margin-right: 0;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .tab-content {
        padding: 12px;
    }

    .calendar-grid {
        padding: 8px;
        gap: 1px;
    }

    .calendar-day {
        min-height: 35px;
        max-height: 35px;
        font-size: 0.75rem;
    }

    .calendar-day-header {
        font-size: 0.7rem;
        padding: 6px 1px;
    }

    .calendar-month {
        font-size: 0.9rem;
    }

    .calendar-nav-arrow {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-day {
        min-height: 32px;
        max-height: 32px;
    }

    .calendar-grid {
        padding: 6px;
    }
}

/* Very small mobile devices (< 320px) */
@media (max-width: 320px) {
    .container {
        padding: 5px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .calendar-grid {
        padding: 5px;
        gap: 1px;
    }

    .calendar-day {
        min-height: 30px;
        max-height: 30px;
        font-size: 0.7rem;
    }

    .calendar-day-header {
        font-size: 0.65rem;
        padding: 4px 1px;
        height: 30px;
    }

    .calendar-month {
        font-size: 0.85rem;
    }

    .calendar-nav-arrow {
        min-width: 30px;
        height: 30px;
        font-size: 0.8rem;
        padding: 6px;
    }

    .tab-content {
        padding: 10px;
    }

    .modal-content {
        width: calc(100vw - 10px);
        margin: 5px;
        padding: 15px;
    }
}

/* Error styling for form validation */
.error {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.1) !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}