/**
 * Checklist Trader Pro - Stili CSS
 * Version: 5.2.8
 */

/* ============================================
   NAVIGAZIONE MENU
   ============================================ */
.trader-nav-menu {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: -20px -20px 30px -20px;
    padding: 0;
}

.trader-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trader-nav-item {
    flex: 1;
    max-width: 300px;
}

.trader-nav-item a {
    display: block;
    padding: 18px 25px;
    text-align: center;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.trader-nav-item a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.trader-nav-item.active a {
    color: white;
    border-bottom-color: white;
    background: rgba(255,255,255,0.15);
}

.trader-nav-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .trader-nav-item a {
        padding: 12px 10px;
        font-size: 13px;
    }
    .trader-nav-icon {
        font-size: 18px;
        margin-bottom: 3px;
    }
}

/* ============================================
   CONTAINER PRINCIPALE
   ============================================ */
.checklist-trader-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.checklist-trader-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* ============================================
   GESTIONE CONTI
   ============================================ */
.accounts-management-section {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.accounts-management-section h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 15px;
}

.accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.account-card {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 2px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.account-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.account-info {
    flex: 1;
}

.account-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.account-size {
    color: #27ae60;
    font-size: 13px;
    font-weight: 600;
}

.account-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.account-delete:hover {
    background: #c0392b;
}

.btn-add-account {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
}

.btn-add-account:hover {
    background: #229954;
}

/* Modal Conti */
.account-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.account-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.account-modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.account-modal-content h3 {
    margin-top: 0;
    color: #2c3e50;
}

.account-form-field {
    margin-bottom: 15px;
}

.account-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.account-form-field input,
.account-form-field select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.account-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.account-modal-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cancel-account {
    background: #95a5a6;
    color: white;
}

.btn-cancel-account:hover {
    background: #7f8c8d;
}

.btn-save-account {
    background: #27ae60;
    color: white;
}

.btn-save-account:hover {
    background: #229954;
}

.trade-account-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ============================================
   SEZIONI CHECKLIST
   ============================================ */
.date-selector {
    text-align: center;
    margin-bottom: 30px;
}

.date-selector input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid #3498db;
    border-radius: 4px;
}

.section-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 15px;
    text-align: center;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    transition: background 0.3s;
}

.checklist-item:hover {
    background: #e9ecef;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.checklist-item label {
    cursor: pointer;
    flex: 1;
}

/* ============================================
   RIFLESSIONI & ERRORI
   ============================================ */
.reflection-item,
.error-item {
    margin-bottom: 20px;
}

.reflection-item label,
.error-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.reflection-item input,
.reflection-item textarea,
.error-item input,
.error-item textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.error-section {
    background: #fff9e6;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid #f39c12;
}

.error-amount-positive {
    color: #27ae60;
    font-weight: 600;
}

.error-amount-negative {
    color: #e74c3c;
    font-weight: 600;
}

/* ============================================
   TRADING OPERATIONS
   ============================================ */
.trading-operations {
    margin-top: 20px;
}

.add-trade-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    margin: 0 auto 20px auto;
}

.add-trade-btn:hover {
    background: #229954;
}

.trade-form {
    display: none;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #3498db;
}

.trade-form.show {
    display: block;
}

.trade-form h4 {
    color: #2c3e50;
    margin-top: 0;
}

.trade-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.trade-form-row.full-width {
    grid-template-columns: 1fr;
}

.trade-form-field {
    display: flex;
    flex-direction: column;
}

.trade-form-field label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.trade-form-field input,
.trade-form-field select {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.trade-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel-trade {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-cancel-trade:hover {
    background: #7f8c8d;
}

.btn-add-trade {
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-add-trade:hover {
    background: #229954;
}

.field-hint {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 3px;
}

/* ============================================
   LISTA TRADE
   ============================================ */
.trades-list {
    margin-top: 20px;
}

.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.trade-item.win {
    border-left-color: #27ae60;
}

.trade-item.loss {
    border-left-color: #e74c3c;
}

.trade-item.breakeven {
    border-left-color: #f39c12;
}

.trade-info {
    flex: 1;
}

.trade-asset {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.trade-direction {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.trade-direction.long {
    background: #d4edda;
    color: #155724;
}

.trade-direction.short {
    background: #f8d7da;
    color: #721c24;
}

.trade-details {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.trade-result {
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
    margin-right: 10px;
}

.trade-result.win {
    background: #27ae60;
    color: white;
}

.trade-result.loss {
    background: #e74c3c;
    color: white;
}

.trade-result.breakeven {
    background: #f39c12;
    color: white;
}

.trade-delete,
.trade-edit,
.trade-duplicate {
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.trade-delete {
    background: #e74c3c;
}

.trade-delete:hover {
    background: #c0392b;
}

.trade-edit {
    background: #3498db;
}

.trade-edit:hover {
    background: #2980b9;
}

.trade-duplicate {
    background: #9b59b6;
}

.trade-duplicate:hover {
    background: #8e44ad;
}

.trade-pnl {
    font-weight: bold;
    margin-top: 5px;
}

.trade-pnl.positive {
    color: #27ae60;
}

.trade-pnl.negative {
    color: #e74c3c;
}

/* Trade Screenshot */
#trade-screenshot-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border-radius: 5px;
    border: 2px solid #ddd;
    margin-top: 5px;
}

#trade-screenshot {
    padding: 8px;
    border: 2px dashed #2ecc71;
    border-radius: 5px;
    background: #e8f8f5;
    cursor: pointer;
}

#trade-screenshot:hover {
    background: #d5f4e6;
}

.trade-screenshot-img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
    border: 2px solid #ddd;
    cursor: pointer;
    margin-top: 5px;
}

.trade-screenshot-img:hover {
    border-color: #3498db;
    transform: scale(1.02);
    transition: all 0.2s;
}

/* ============================================
   PULSANTI SALVATAGGIO
   ============================================ */
.save-button-container {
    text-align: center;
    margin-top: 30px;
}

.save-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.save-button.saving {
    opacity: 0.7;
    cursor: not-allowed;
}

.save-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

.save-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.save-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.delete-checklist-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
    display: none;
}

.delete-checklist-btn.show {
    display: inline-block;
}

.delete-checklist-btn:hover {
    background: #c0392b;
}

/* ============================================
   STORICO - FILTRI E STATISTICHE
   ============================================ */
.storico-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.storico-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.filter-section,
.manage-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-field {
    flex: 1;
    min-width: 200px;
}

.filter-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.filter-field input,
.filter-field select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.btn-filter {
    padding: 10px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-filter:hover {
    background: #2980b9;
}

.btn-reset-filter {
    padding: 10px 25px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-reset-filter:hover {
    background: #7f8c8d;
}

.filter-active-message {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #17a2b8;
}

/* Gestione Checklist */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.checklist-item-manage {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.2s;
}

.checklist-item-manage:hover {
    border-color: #3498db;
}

.checklist-item-manage input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checklist-item-manage label {
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
}

.manage-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-select-all,
.btn-select-none {
    padding: 8px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-delete-selected {
    padding: 10px 25px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.btn-delete-selected:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.selected-count {
    padding: 10px;
    background: #fff3cd;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    font-weight: 600;
    color: #856404;
}

/* Statistiche */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%);
}

.stat-card.yellow {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
}

.stat-number {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    opacity: 0.95;
}

.performance-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.performance-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.performance-value.positive {
    color: #27ae60;
}

.performance-value.negative {
    color: #e74c3c;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.insight-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.insight-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.insight-value {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

/* ============================================
   CALENDARIO
   ============================================ */
.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
}

.calendar-header button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.calendar-header button:hover {
    background: #2980b9;
}

#calendar-title {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

#today-btn {
    background: #27ae60 !important;
    padding: 5px 15px !important;
    font-size: 14px !important;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-weekday {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: #34495e;
    color: white;
    border-radius: 5px;
    font-size: 14px;
}

.calendar-day {
    min-height: 100px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.calendar-day.other-month {
    opacity: 0.3;
    cursor: default;
}

.calendar-day.positive {
    background: #d4edda;
    border-color: #28a745;
}

.calendar-day.negative {
    background: #f8d7da;
    border-color: #dc3545;
}

.calendar-day.breakeven {
    background: #fff3cd;
    border-color: #ffc107;
}

.calendar-day.has-error {
    background: #fff9e6;
    border-color: #f39c12;
}

.calendar-day.no-trades {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.day-number {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.day-pnl {
    font-size: 14px;
    font-weight: bold;
    margin-top: 5px;
}

.day-pnl.positive {
    color: #28a745;
}

.day-pnl.negative {
    color: #dc3545;
}

.day-error-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

/* Modal Calendario */
.calendar-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.calendar-modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.modal-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
}

.modal-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.modal-section.error-section {
    background: #fff9e6;
    border-left-color: #f39c12;
}

.modal-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
}

.modal-pnl {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-pnl.positive {
    background: #d4edda;
    color: #28a745;
}

.modal-pnl.negative {
    background: #f8d7da;
    color: #dc3545;
}

.modal-pnl.breakeven {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .checklist-trader-container {
        padding: 15px;
    }
    
    .trade-form-row {
        grid-template-columns: 1fr;
    }
    
    .trade-item {
        flex-direction: column;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 5px;
        font-size: 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
