/* Dashboard Widgets Styling */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

.dashboard-section {
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
}

/* Market Trends Container - Add drop shadow */
.market-trends-container {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Trend Cards */
.trend-card {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.trend-card {
    padding: 0.75rem;
    display: flex;
    align-items: center;
}

/* Ensure proper spacing in the market grid */
.dashboard-section .col-md-4, .dashboard-section .col-md-2 {
    margin-bottom: 1rem;
}


.asset-type {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.3px;
}

.asset-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.change-percentage, .change-value {
    font-size: 1rem;
    font-weight: 500;
}

.positive {
    color: var(--color-positive);
}

.negative {
    color: var(--color-negative);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* Balance Card - Modern Clean Design */
.balance-card {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-grey-dark);
    overflow: hidden;
}

.balance-card .card-body {
    padding: 3rem;
}

.balance-card .card-body.loading {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading State */
.balance-loading {
    text-align: center;
    width: 100%;
}

.loading-shimmer {
    background: linear-gradient(90deg, var(--color-grey) 25%, var(--color-grey-dark) 50%, var(--color-grey) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.vector-shimmer {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.balance-shimmer {
    width: 100%;
    max-width: 300px;
    height: 60px;
}

@media (max-width: 991px) {
    .balance-shimmer {
        margin-left: auto;
        margin-right: auto;
    }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-text {
    color: var(--color-dark);
    opacity: 0.6;
    font-size: 0.95rem;
    margin: 0;
}

/* Balance Hero Section */
.balance-hero {
}

.dashboard-vector-column {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-balance-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 2rem;
}

@media (max-width: 991px) {
    .dashboard-balance-column {
        padding-left: 0;
        margin-top: 2rem;
    }
}

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

.balance-stats-row {
    border-top: 1px solid var(--color-grey-dark);
    padding-top: 2rem;
}

.balance-label {
    font-size: 0.875rem;
    color: var(--color-dark);
    opacity: 0.6;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.balance-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-dark);
}


.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--color-dark);
}

.stat-value.positive {
    color: var(--color-positive);
}

.stat-value.negative {
    color: var(--color-negative);
}

.stat-value.neutral {
    color: var(--color-dark);
    opacity: 0.7;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-dark);
    opacity: 0.6;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state p {
    font-size: 1rem;
    color: var(--color-dark);
    opacity: 0.6;
    margin-bottom: 0;
}

/* Ensure animated spans inherit all styling from parent elements */
.animated-balance,
.animated-percentage,
.animated-change-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

/* Daily Digest Card Styles */
.daily-digest-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-grey-dark, #f3f4f6);
    overflow: hidden;
    margin-bottom: 20px;
    padding: 3rem;
}

.daily-digest-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.daily-digest-card .digest-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.daily-digest-card .digest-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-dark, #1f2937);
    margin: 0;
    letter-spacing: -0.025em;
}

.daily-digest-card .digest-timestamp {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-dark, #6b7280);
    margin: 0;
    opacity: 0.8;
}

.daily-digest-card .digest-actions {
    display: flex;
    gap: 0.5rem;
}

.daily-digest-card .digest-actions .btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.daily-digest-card .card-body {
    line-height: 1.8;
    color: #374151;
    min-height: 150px;
}

.daily-digest-card .card-body p {
    margin-bottom: 12px;
}

.daily-digest-card .card-body strong {
    color: #1f2937;
    font-weight: 600;
}

.daily-digest-card .card-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-grey-dark, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

.daily-digest-card .card-footer .btn-link {
    color: #22c55e;
    text-decoration: none;
    font-size: 0.9rem;
}

.daily-digest-card .card-footer .btn-link:hover {
    color: #16a34a;
    text-decoration: underline;
}

.daily-digest-card .card-body.error {
    color: #dc2626;
}

/* Loading indicator overlay styles */
.daily-digest-card .card-body.loading,
.loading-overlay {
    position: relative;
    min-height: 100px;
}

.daily-digest-card .card-body.loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%234ade80" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform></circle></svg>') center center no-repeat;
    background-size: 50px;
    border-radius: 8px;
    z-index: 10;
}

/* Loading placeholder styles */
.loading-placeholder {
    background-color: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

.loading-placeholder p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* Market logo fallback */
.market-logo-fallback {
    font-size: 14px;
    font-weight: bold;
}

/* Trend item styles */
.trend-item {
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.trend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.trend-label {
    font-size: 14px;
    color: #6b7280;
}

.trend-value {
    font-size: 14px;
    font-weight: 600;
}

/* Portfolio History Card Styles */
.portfolio-history-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-grey-dark, #f3f4f6);
    font-family: 'Poppins', sans-serif;
}

.portfolio-history-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.portfolio-history-card .history-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portfolio-history-card .history-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-dark, #1f2937);
    margin: 0;
    letter-spacing: -0.025em;
}

.portfolio-history-card .history-description {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-dark, #6b7280);
    margin: 0;
    opacity: 0.8;
}

.portfolio-history-card .period-selector {
    display: flex;
    gap: 0.5rem;
}

.portfolio-history-card .period-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.portfolio-history-card .card-body {
    min-height: 250px;
}

.portfolio-history-card .chart-container {
    height: 200px;
    position: relative;
}

.portfolio-history-card .chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6b7280;
    text-align: center;
}

.portfolio-history-card .chart-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.portfolio-history-card .card-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-grey-dark, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

.portfolio-history-card .history-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portfolio-history-card .stat-label {
    color: #6b7280;
    font-size: 0.9rem;
}

.portfolio-history-card .stat-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.portfolio-history-card .stat-percentage {
    font-size: 0.85rem;
}

.portfolio-history-card .stat-value.positive,
.portfolio-history-card .stat-percentage.positive {
    color: #22c55e;
}

.portfolio-history-card .stat-value.negative,
.portfolio-history-card .stat-percentage.negative {
    color: #ef4444;
}

/* Daily Digest Card Styles */
.daily-digest-card {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-grey-dark, #f3f4f6);
    font-family: 'Poppins', sans-serif;
}

.daily-digest-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.daily-digest-card .digest-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.daily-digest-card .digest-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-dark, #1f2937);
    margin: 0;
    letter-spacing: -0.025em;
}

.daily-digest-card .digest-timestamp {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-dark, #6b7280);
    margin: 0;
    opacity: 0.8;
}

.daily-digest-card .digest-actions {
    display: flex;
    gap: 0.5rem;
}

.daily-digest-card .digest-actions .btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.daily-digest-card .card-body {
    line-height: 1.8;
    color: #374151;
    min-height: 150px;
}

.daily-digest-card .card-body p {
    margin-bottom: 12px;
}

.daily-digest-card .card-body strong {
    color: #1f2937;
    font-weight: 600;
}

.daily-digest-card .card-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-grey-dark, #e5e7eb);
    display: flex;
    justify-content: flex-end;
}

.daily-digest-card .card-footer .btn-link {
    color: #22c55e;
    text-decoration: none;
    font-size: 0.9rem;
}

.daily-digest-card .card-footer .btn-link:hover {
    color: #16a34a;
    text-decoration: underline;
}

/* Digest Loading State */
.daily-digest-card .digest-loading {
    min-height: 150px;
}

/* Digest Error State */
.daily-digest-card .digest-error-state {
    text-align: center;
    padding: 2rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.daily-digest-card .digest-error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.daily-digest-card .digest-error-state h4 {
    color: var(--color-dark, #374151);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.daily-digest-card .digest-error-state p {
    color: var(--color-dark, #6b7280);
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.daily-digest-card .digest-error-state .retry-btn {
    font-family: 'Poppins', sans-serif;
}

/* Digest Result */
.daily-digest-card .digest-result {
    line-height: 1.8;
}

/* Segment card states */
.segment-card.inactive-portfolio {
    opacity: 0.7;
    background-color: #f0f0f0;
}

.segment-card.inactive-portfolio .circle-label {
    color: #666;
}

.segment-card.inactive-portfolio .value {
    font-style: italic;
    color: #888;
}

/* Dashboard loading indicator */
.dashboard-section .loading {
    position: relative;
    min-height: 100px;
}

.dashboard-section .loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><circle cx="50" cy="50" fill="none" stroke="%234ade80" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform></circle></svg>') center center no-repeat;
    background-size: 50px;
    border-radius: 8px;
    z-index: 10;
}

/* Trend item styles */
.trend-item {
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.trend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.trend-label {
    font-size: 14px;
    color: #6b7280;
}

.trend-value {
    font-size: 14px;
    font-weight: 600;
}

.market-logo-fallback {
    font-size: 14px;
    font-weight: bold;
}
