/* FMM26 Tracker - Phase 6 Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

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

/* Navigation */
.nav-bar {
    background-color: #2c3e50;
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
}

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

.nav-menu a.active {
    background-color: #3498db;
}

/* Setup Screen */
.setup-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.setup-title {
    text-align: center;
    margin-bottom: 24px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Dashboard */
.dashboard-title {
    color: #2c3e50;
    margin: 24px 0 16px 0;
    font-size: 1.8rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.info-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #3498db;
}

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

.info-card h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.info-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.info-card .value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #3498db;
    margin-top: 8px;
}

/* Team Pages */
.page-title {
    color: #2c3e50;
    margin: 24px 0 16px 0;
    font-size: 1.8rem;
}

.main-team-header,
.reserve-team-header,
.report-header,
.dynamics-header,
.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.report-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.page-description {
    color: #666;
    margin: 8px 0 0 0;
    font-size: 0.95rem;
}

.team-controls {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.player-count {
    margin-bottom: 16px;
    color: #666;
    font-size: 0.95rem;
}

.search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.filter-box select,
.attribute-box button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
}

.filter-box select:focus {
    outline: none;
    border-color: #3498db;
}

/* Player List */
.player-list {
    display: grid;
    gap: 16px;
}

.player-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #2ecc71;
}

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

/* Reserve team card styling */
.player-card.reserve {
    border-left: 4px solid #f39c12;
}

.player-basic-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.player-basic-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
    flex: 1;
    min-width: 150px;
}

.player-position,
.player-age,
.player-role {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.player-position {
    background-color: #e3f2fd;
    color: #1976d2;
}

.player-age {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.player-role {
    background-color: #e8f5e9;
    color: #388e3c;
}

.player-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.attr-item {
    font-size: 0.9rem;
    color: #666;
}

.attr-item strong {
    color: #2c3e50;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    color: #999;
}

/* Report Page Styles */
.report-content {
    display: grid;
    gap: 24px;
}

.report-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-title {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    padding-bottom: 12px;
    border-bottom: 2px solid;
}

.section-title.positive {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.section-title.negative {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

.report-list {
    display: grid;
    gap: 16px;
}

.report-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #ddd;
}

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

.report-card:nth-child(odd) {
    border-left-color: #3498db;
}

.report-card:nth-child(even) {
    border-left-color: #95a5a6;
}

.report-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.report-header-card h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
    flex: 1;
}

.report-date {
    font-size: 0.9rem;
    color: #666;
}

.report-body {
    color: #666;
    line-height: 1.6;
}

.report-body p {
    margin: 0;
}

/* Dynamics Page Styles */
.dynamics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.dynamics-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #9b59b6;
}

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

.dynamics-card-title {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    border-bottom: 2px solid #9b59b6;
    padding-bottom: 8px;
}

.dynamics-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dynamics-field {
    display: flex;
    gap: 8px;
    line-height: 1.6;
}

.field-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
    flex-shrink: 0;
}

.field-value {
    color: #555;
    flex: 1;
}

.empty-field {
    color: #999;
    font-style: italic;
    padding: 8px 0;
}

/* NEW: Finance Page Styles */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.finance-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #1abc9c;
}

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

.finance-card-header {
    margin-bottom: 16px;
}

.finance-card-title {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.finance-card-body {
    margin-bottom: 12px;
}

.finance-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #27ae60;
    word-wrap: break-word;
}

.finance-card-footer {
    display: flex;
    justify-content: flex-end;
}

.finance-type {
    font-size: 0.8rem;
    padding: 4px 12px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s, opacity 0.3s, transform 0.1s;
    display: inline-block;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

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

.btn-danger {
    background-color: #e74c3c;
    color: white;
    margin-top: 8px;
}

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

.btn-move {
    background-color: #f39c12;
    color: white;
    width: 100%;
}

.btn-move:hover {
    background-color: #e67e22;
}

.btn-full {
    width: 100%;
    margin-top: 16px;
}

/* Add Player Button */
.main-team-header .btn-primary,
.reserve-team-header .btn-primary,
.report-header .btn-primary,
.finance-header .btn-primary {
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* Move Player Section */
.move-player-section {
    margin: 16px 0;
    padding: 16px;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.move-player-section p {
    margin: 0 0 12px 0;
    color: #2c3e50;
}

/* Attributes Management */
.add-attribute-section,
.existing-attributes-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.add-attribute-section h3,
.existing-attributes-section h3 {
    margin-top: 0;
    color: #2c3e50;
}

.attribute-item {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.attribute-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.attribute-item button {
    padding: 8px 16px;
    white-space: nowrap;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    border: none;
    background: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background-color: #f5f5f5;
}

/* Confirm Delete Modal */
#confirm-delete-modal-main .modal-content,
#confirm-delete-modal-reserve .modal-content,
#confirm-delete-report-modal .modal-content,
#confirm-delete-finance-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

#confirm-delete-modal-main p,
#confirm-delete-modal-reserve p,
#confirm-delete-report-modal p,
#confirm-delete-finance-modal p {
    color: #666;
    margin-bottom: 16px;
}

/* Placeholder content */
.placeholder-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    color: #666;
    margin-top: 16px;
}

/* Form in modals */
#add-player-form-main .form-group,
#add-player-form-reserve .form-group,
#edit-player-form-main .form-group,
#edit-player-form-reserve .form-group,
#add-report-form .form-group,
#edit-dynamics-modal .form-group,
#add-finance-form .form-group,
#edit-finance-modal .form-group {
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 8px;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-menu a {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .setup-container,
    .modal-content {
        padding: 16px;
    }
    
    .main-team-header,
    .reserve-team-header,
    .report-header,
    .dynamics-header,
    .finance-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .main-team-header .btn,
    .reserve-team-header .btn,
    .report-header .btn,
    .finance-header .btn {
        width: 100%;
    }
    
    .team-controls {
        grid-template-columns: 1fr;
    }
    
    .player-basic-info h3 {
        font-size: 1rem;
        min-width: 100%;
    }
    
    .player-card,
    .report-card,
    .dynamics-card,
    .finance-card {
        padding: 16px;
    }
    
    .player-attributes {
        flex-direction: column;
        gap: 8px;
    }
    
    .report-header-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dynamics-grid,
    .finance-grid {
        grid-template-columns: 1fr;
    }
    
    .dynamics-field {
        flex-direction: column;
        gap: 4px;
    }
    
    .field-label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .player-basic-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .player-position,
    .player-age,
    .player-role {
        font-size: 0.8rem;
    }
}

/* PHASE 3-6: report textarea & finance polish */
.report-section {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.report-body p {
    white-space: pre-wrap;
    word-wrap: break-word;
}
.finance-value {
    word-break: break-word;
}
@media (max-width: 480px) {
    .btn-move {
        width: 100%;
    }
}
