/* Dashboard V2 - Tab-based Layout Styles */

/* Main Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* User Summary Bar */
.user-summary-bar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-section h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.portfolio-summary {
    display: flex;
    gap: 30px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
    padding: 10px;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #007bff;
    background: #f0f8ff;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #f0f8ff;
}

/* Content Area */
.content-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 600px;
}

/* Left Panel */
.left-panel {
    background: #fff;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Items */
.tab-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #333;
}

.section-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.section-item.expandable {
    font-weight: 500;
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.section-item.expanded .expand-icon {
    transform: rotate(90deg);
}

.section-content {
    padding: 15px;
    background: #fff;
    border-left: 3px solid #007bff;
    margin-left: 20px;
    margin-top: 10px;
}

/* Right Panel - Results */
.right-panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.results-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-results {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.results-content {
    color: #333;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Profile Navigation */
.profile-navigation {
    margin-bottom: 20px;
}

.profile-nav-item {
    padding: 12px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-nav-item:hover {
    background: #e9ecef;
}

.profile-nav-item.active {
    background: #007bff;
    color: white;
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

/* Cards Section */
.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-card-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.add-card-btn:hover {
    background: #218838;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.card-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-info {
    flex: 1;
}

.card-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.card-fee {
    color: #666;
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn {
    background: #007bff;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

/* Portfolio Metrics */
.portfolio-metrics {
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    text-align: center;
}

.portfolio-metrics h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.metric-value {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}

.metric-note {
    color: #666;
    font-size: 12px;
}

.metric-note a {
    color: #007bff;
    text-decoration: none;
}

/* Forms */
.scenario-form, #profile-form, #goals-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
}

/* Collapsible Sections */
.collapsible-section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.collapsible-header {
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapse-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.collapsible-section.expanded .collapse-icon {
    transform: rotate(45deg);
}

.collapsible-content {
    padding: 15px;
    background: #fff;
}

/* Spending Grid */
.spending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Goals Checklist */
.goals-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
}

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

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-info {
    flex: 1;
}

.history-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.history-date {
    font-size: 12px;
    color: #999;
}

/* Buttons */
.primary-btn, .analysis-btn {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.primary-btn:hover, .analysis-btn:hover {
    background: #0056b3;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Coming Soon */
.coming-soon {
    font-size: 18px;
    color: #007bff;
    text-align: center;
    margin: 40px 0 20px;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
}

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

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

/* Loading States */
.loading-state {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-area {
        grid-template-columns: 1fr;
    }
    
    .right-panel {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .portfolio-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .summary-item {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .tab-navigation {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .spending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Fix for notification messages in forms */
.form-section > .notification-message {
    width: 100% !important;
    display: block !important;
    margin-bottom: 15px;
}