/* Dashboard specific styles */
#dashboard {
    padding: 50px 0;
    background-color: var(--container-bg-color); /* Changed */
    border-top: 1px solid var(--soft-grey); /* Changed */
}

/* Welcome Header */
.welcome-header {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark); /* Changed */
}

.welcome-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--text-dark); /* Changed from --primary-dark-blue to ensure readability in dark theme */
}

.welcome-header .membership-status {
    font-size: 1.1em;
    color: var(--accent-gold); /* Changed */
    font-weight: bold;
    margin-bottom: 5px;
}

.welcome-header .current-date-time {
    font-size: 0.9em;
    color: var(--text-dark); /* Kept specific for date/time, can also use var(--text-dark) with opacity */
}

/* Account Summary Grid */
.account-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background-color: var(--primary-dark-blue); /* Changed */
    color: var(--text-light); /* Changed to text-light for readability on dark blue card background */
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); /* Enhanced shadow */
    border: 1px solid var(--border-light); /* Subtle white border, now uses var */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Added for advanced look */
}

.summary-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3); /* Stronger shadow on hover */
}

/* Glass effect for cards */
.glass-effect {
    background-color: var(--header-bg-rgba); /* Use transparent color with blur */
    backdrop-filter: blur(8px); /* Apply blur effect */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Lighter, more subtle border */
    color: var(--text-dark); /* Adjust text color for readability on light/blurred background */
}

body.dark-theme .glass-effect {
    background-color: var(--header-bg-rgba); /* Dark theme version of transparent color */
    border: 1px solid rgba(0, 0, 0, 0.2); /* Darker, more subtle border */
    color: var(--text-dark);
}

/* Specific text color overrides for .glass-effect cards */
.glass-effect h3 {
    color: var(--text-dark); /* Ensure heading is visible */
    opacity: 0.9;
}
body.dark-theme .glass-effect h3 {
    color: var(--text-dark); /* Ensure heading is visible in dark theme */
}

.glass-effect .summary-value {
    color: var(--primary-dark-blue); /* Strong contrast for values */
    text-shadow: none;
}
body.dark-theme .glass-effect .summary-value {
    color: var(--accent-gold); /* Strong contrast for values in dark theme */
}

.summary-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: var(--text-light); /* Changed to text-light for readability on dark blue card background */
    opacity: 0.8;
}

.summary-card .summary-value {
    font-size: 2.2em; /* Slightly larger font for prominence */
    font-weight: bold;
    color: var(--accent-gold); /* Changed */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    margin-top: auto; /* Push value to bottom */
}

.summary-card .summary-value.positive {
    color: var(--success-green); /* Green for positive */
}

.summary-card .summary-value.negative {
    color: var(--error-red); /* Red for negative */
}

/* Portfolio Performance Chart Placeholder */
.chart-container {
    background-color: var(--section-alt-bg);
    border: 1px solid var(--soft-grey);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.chart-placeholder {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-dark);
    opacity: 0.7;
}

/* Interactive Buttons Grid */
.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 50px;
}

.dashboard-actions-grid .btn-primary {
    width: 100%; /* Make buttons fill their grid cell */
    padding: 10px 8px; /* Adjusted padding for smaller buttons */
    font-size: 0.85em; /* Adjusted font size for smaller buttons */
    background-color: var(--primary-dark-blue); /* Changed */
    color: var(--text-light); /* Changed to text-light for readability on dark blue button */
    border: 1px solid var(--accent-gold); /* Changed */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; /* Enhanced transition */
}

.dashboard-actions-grid .btn-primary:hover {
    background-color: var(--accent-gold); /* Changed */
    color: var(--primary-dark-blue); /* Changed */
    border-color: var(--primary-dark-blue); /* Changed */
    transform: translateY(-3px); /* Lift effect on hover */
    box-shadow: var(--btn-hover-shadow);
}

.dashboard-actions-grid .btn-primary:active {
    transform: translateY(0); /* Press effect */
    box-shadow: var(--btn-shadow);
}

/* Shares Breakdown Section */
.shares-breakdown-section,
.transaction-history-section {
    background-color: var(--container-bg-color); /* Changed */
    border: 1px solid var(--soft-grey); /* Changed */
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow-x: auto; /* Enable horizontal scrolling for tables on small screens */
    transition: box-shadow 0.3s ease; /* Added for advanced look */
}

.shares-breakdown-section:hover,
.transaction-history-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-light); /* Use border-light for table cell borders */
    text-align: left;
    color: var(--text-dark); /* Changed */
}

table thead {
    border-bottom: 2px solid var(--accent-gold); /* Stronger separator for table header */
}

table th {
    background-color: var(--table-header-bg); /* Use new variable for table header background */
    font-weight: bold;
    color: var(--text-dark); /* Changed from primary-dark-blue for dark theme contrast */
    text-transform: uppercase;
    font-size: 0.9em;
}

table tbody tr:hover {
    background-color: var(--soft-grey); /* Lighter gold hover */
}

table .gain {
    color: var(--success-green);
    font-weight: bold;
}

table .loss {
    color: var(--error-red);
    font-weight: bold;
}

/* Comments section styles (kept largely same, updated colors) */
.comments-section-title {
    margin-top: 60px; /* More spacing before comments section */
    margin-bottom: 40px;
}

.comments-container {
    background-color: var(--container-bg-color); /* Changed */
    border: 1px solid var(--soft-grey); /* Changed */
    border-radius: 12px;
    padding: 35px; /* Increased from 30px */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    transition: box-shadow 0.3s ease; /* Added for advanced look */
}

.comments-container:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.comment-input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--soft-grey); /* Changed */
}

.comment-input-area textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--soft-grey); /* Changed */
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1em;
    resize: vertical;
    min-height: 80px;
    background-color: var(--section-alt-bg); /* Changed */
    color: var(--text-dark); /* Changed */
}

.comment-input-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center; /* Added for horizontal centering on larger screens */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.comment-input-controls input[type="number"] {
    flex-grow: 1;
    min-width: 120px;
    padding: 8px;
    border: 1px solid var(--soft-grey); /* Changed */
    border-radius: 5px;
    background-color: var(--section-alt-bg); /* Changed */
    color: var(--text-dark); /* Changed */
    font-size: 0.95em;
    text-align: center;
}

.comment-input-controls input[type="file"] {
    flex-grow: 1;
    min-width: 150px;
    font-size: 0.9em;
    padding: 5px 0; /* Adjust padding for file input */
    color: var(--text-dark); /* Ensure file input text is visible */
}

.comment-input-controls .btn-primary {
    flex-shrink: 0; /* Prevent button from shrinking */
    padding: 10px 18px; /* Adjusted padding for consistent height with other buttons */
    font-size: 0.95em;
    min-width: 120px; /* Ensure a minimum width */
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    justify-content: center; /* Added to center image previews */
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--soft-grey); /* Changed */
}

.image-preview-item img {
    max-width: 100%; /* Max width for images within comments */
    max-height: 300px; /* Max height for images within comments */
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    display: block; /* Ensures it takes full width */
    margin-left: auto; /* Center images within comments */
    margin-right: auto; /* Center images within comments */
}

.image-preview-item .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    cursor: pointer;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-card {
    background-color: var(--soft-grey); /* Changed */
    border: 1px solid var(--border-light); /* Changed */
    border-radius: 8px;
    padding: 20px; /* Increased from 15px */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 1px solid var(--accent-gold); /* Changed */
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    text-align: left; /* Explicitly keep author info left-aligned for structure */
}

.comment-author-info a {
    font-weight: bold;
    color: var(--text-dark); /* Changed */
    text-decoration: none;
}

.comment-author-info a:hover {
    color: var(--accent-gold); /* Changed */
}

.comment-username {
    font-size: 0.9em;
    color: var(--text-dark); /* Kept specific for username, can also use var(--text-dark) with opacity */
}

.comment-timestamp {
    font-size: 0.8em;
    color: var(--text-dark); /* Kept specific for timestamp, can also use var(--text-dark) with opacity */
}

.comment-content {
    color: var(--text-dark); /* Changed */
    line-height: 1.5;
    word-wrap: break-word; /* Ensure long words break */
    text-align: left; /* Changed from center for readability within comments */
}

.comment-content img {
    max-width: 100%; /* Max width for images within comments */
    max-height: 300px; /* Max height for images within comments */
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    display: block; /* Ensures it takes full width */
    margin-left: auto; /* Center images within comments */
    margin-right: auto; /* Center images within comments */
}

.tip-amount {
    font-weight: bold;
    color: var(--success-green); /* Changed */
    margin-top: 10px;
    display: block; /* Ensures it starts on a new line */
    text-align: center; /* Center tip amount */
}

.load-more-btn {
    margin-top: 20px;
    width: fit-content;
    align-self: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Security & Support Section */
.security-support-section {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 40px;
    padding: 30px;
    background-color: var(--primary-dark-blue); /* Changed */
    color: var(--text-light); /* Changed to text-light for readability on dark blue background */
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Added for advanced look */
}

.security-support-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.security-support-section p {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--text-light); /* Changed to text-light for readability on dark blue background */
}

.security-support-section .btn-primary {
    background-color: var(--accent-gold); /* Changed */
    color: var(--primary-dark-blue); /* Changed */
    border: 1px solid var(--accent-gold); /* Changed */
    font-size: 1em;
    padding: 12px 25px;
    margin-bottom: 10px;
}

.security-support-section .btn-primary:hover {
    background-color: #C2A22F; /* Darker gold */
    color: var(--primary-dark-blue);
    border-color: #C2A22F;
}

.security-support-section .support-note {
    font-size: 0.85em;
    color: var(--text-light); /* Changed from var(--text-dark) to var(--text-light) for contrast on dark background */
    margin-top: 10px;
}

.logout-btn {
    display: block;
    margin: 40px auto 20px auto;
    background-color: var(--error-red); /* Changed */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.logout-btn:hover {
    background-color: #D32F2F; /* Darker red */
    transform: translateY(-3px);
    box-shadow: var(--btn-hover-shadow);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: var(--btn-shadow);
}

/* Skeleton Loading Styles */
.skeleton-line {
    background-color: var(--soft-grey);
    height: 1em;
    margin: 0.5em 0;
    border-radius: 4px;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-box {
    background-color: var(--soft-grey);
    border-radius: 8px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Responsive adjustments for dashboard */
@media (max-width: 768px) {
    .welcome-header h2 {
        font-size: 2em;
    }
    .account-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .summary-card {
        padding: 20px;
        min-height: 100px;
    }
    .summary-card .summary-value {
        font-size: 1.5em;
    }
    .dashboard-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .dashboard-actions-grid .btn-primary {
        padding: 12px 8px;
        font-size: 0.85em;
    }
    table th, table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    .comments-container {
        padding: 25px;
    }
    .comment-input-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .comment-input-controls input,
    .comment-input-controls .btn-primary {
        width: 100%;
        min-width: unset;
    }
    .security-support-section {
        padding: 20px;
    }
    .chart-placeholder {
        padding: 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .welcome-header h2 {
        font-size: 1.8em;
    }
    .account-summary-grid {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
    }
    .dashboard-actions-grid {
        grid-template-columns: 1fr; /* Stack buttons on very small screens */
    }
    .dashboard-actions-grid .btn-primary {
        font-size: 0.8em;
        padding: 10px 5px;
    }
    .comments-container {
        padding: 20px;
    }
    .comment-card {
        padding: 15px;
    }
    .comment-content {
        font-size: 0.9em;
    }
    .security-support-section .btn-primary {
        font-size: 0.9em;
        padding: 10px 15px;
    }
    .chart-placeholder {
        font-size: 0.8em;
    }
}