/* Portfolio Showcase Section Styles - IMPROVED */
.portfolio-showcase-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #0a1929 0%, #1e3a5f 50%, #0a1929 100%);
    position: relative;
    overflow: hidden;
}

.portfolio-showcase-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(0, 188, 212, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(0, 188, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.portfolio-showcase-section .container {
    position: relative;
    z-index: 1;
}

/* Showcase Header - IMPROVED */
.showcase-header {
    text-align: center;
    margin-bottom: 40px;
}

.showcase-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00bcd4;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 188, 212, 0.3);
}

.showcase-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Explanation Cards - IMPROVED */
.showcase-explanation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.explanation-card {
    background: rgba(15, 30, 45, 0.85);
    border: 1px solid rgba(0, 188, 212, 0.4);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.explanation-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 188, 212, 0.6);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.2);
}

.explanation-card h3 {
    color: #00bcd4;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.explanation-card p {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin: 0;
    font-size: 0.9rem;
}

.explanation-card strong {
    color: #4caf50;
    font-weight: 600;
}

/* Portfolio Table Wrapper - IMPROVED */
.portfolio-table-wrapper {
    background: rgba(15, 30, 45, 0.9);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(0, 188, 212, 0.4);
    margin-bottom: 30px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

/* Portfolio Table Header - IMPROVED */
.portfolio-table-header {
    margin-bottom: 20px;
}

.table-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #00bcd4;
    margin-bottom: 15px;
    text-align: center;
}

.table-nav {
    margin-bottom: 15px;
}

.nav-tabs-portfolio {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-portfolio {
    padding: 8px 16px;
    background: rgba(0, 188, 212, 0.2);
    border: 1px solid rgba(0, 188, 212, 0.5);
    border-radius: 6px;
    color: #00bcd4;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-portfolio.active {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: #ffffff;
    border-color: #00bcd4;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.tab-portfolio:hover:not(.active) {
    background: rgba(0, 188, 212, 0.3);
    border-color: #00bcd4;
}

.table-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn-portfolio {
    padding: 6px 14px;
    background: rgba(0, 188, 212, 0.2);
    border: 1px solid rgba(0, 188, 212, 0.4);
    border-radius: 5px;
    color: #00bcd4;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.control-btn-portfolio:hover {
    background: rgba(0, 188, 212, 0.3);
    border-color: #00bcd4;
}

.control-btn-portfolio.date {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

/* Best Month Highlight - IMPROVED */
.best-month-highlight {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

/* Portfolio Table Container - IMPROVED */
.portfolio-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(0, 188, 212, 0.4);
    margin-bottom: 20px;
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(10, 25, 41, 0.9);
    min-width: 800px;
}

.portfolio-table th {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    padding: 12px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 2px solid rgba(0, 188, 212, 0.4);
    white-space: nowrap;
}

.portfolio-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.portfolio-row:hover {
    background: rgba(0, 188, 212, 0.05);
}

.portfolio-row.visible {
    background: rgba(76, 175, 80, 0.1);
    border-left: 2px solid rgba(76, 175, 80, 0.6);
}

.portfolio-row.censored td:not(.portfolio-positive):not(.portfolio-negative):not(.portfolio-neutral) {
    color: rgba(255, 255, 255, 0.6);
}

/* Blur Effect for Censored Data */
.portfolio-blurred {
    filter: blur(3px);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3) !important;
    user-select: none;
    cursor: not-allowed;
    border-radius: 3px;
    padding: 2px 4px;
}

/* Performance Colors */
.portfolio-positive {
    color: #4caf50 !important;
    font-weight: 600;
}

.portfolio-negative {
    color: #f44336 !important;
    font-weight: 600;
}

.portfolio-neutral {
    color: #ffc107 !important;
    font-weight: 600;
}

/* Footer Stats - IMPROVED */
.portfolio-footer-stats {
    margin-top: 25px;
}

.footer-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.footer-stat-item {
    background: rgba(0, 188, 212, 0.1);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(0, 188, 212, 0.3);
    transition: all 0.3s ease;
}

.footer-stat-item:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 188, 212, 0.6);
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.2);
}

.stat-label-portfolio {
    color: #00bcd4;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.stat-value-portfolio {
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

/* Portfolio Transactions - IMPROVED */
.portfolio-transactions {
    text-align: center;
    padding: 16px;
    background: rgba(0, 188, 212, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 188, 212, 0.2);
}

.transactions-note-portfolio {
    color: #00bcd4;
    font-style: italic;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.transaction-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.transaction-btn-portfolio {
    padding: 10px 20px;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    min-width: 90px;
}

.transaction-btn-portfolio:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.4);
    background: linear-gradient(135deg, #0097a7, #00838f);
}

/* Bottom CTA - IMPROVED */
.showcase-bottom-cta {
    text-align: center;
    margin-top: 35px;
    padding: 30px 25px;
    background: rgba(0, 188, 212, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 188, 212, 0.3);
}

.bottom-cta-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary-portfolio {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #00bcd4, #0097a7);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 188, 212, 0.3);
}

.btn-primary-portfolio:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
    background: linear-gradient(135deg, #0097a7, #00838f);
    text-decoration: none;
    color: white;
}

/* WORST MONTH SECTION - PROPERLY STYLED */
.portfolio-showcase-section.worst-month {
    background: linear-gradient(135deg, 
        #1a0e1e 0%, 
        #2d1829 20%, 
        #4a1d35 40%, 
        #2d1829 60%, 
        #3d2433 80%, 
        #1a0e1e 100%);
    padding: 60px 0;
}

.portfolio-showcase-section.worst-month::before {
    background: radial-gradient(circle at 25% 25%, rgba(244, 67, 54, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(156, 39, 176, 0.1) 0%, transparent 50%);
}

/* Worst Month Header - CONSISTENT WITH BEST MONTH */
.worst-month .showcase-header {
    margin-bottom: 40px;
}

.worst-month .showcase-explanation {
    gap: 20px;
    margin-bottom: 35px;
}

.worst-month .explanation-card {
    border: 1px solid rgba(244, 67, 54, 0.4);
    background: rgba(25, 25, 35, 0.85);
    padding: 20px;
    backdrop-filter: blur(10px);
}

.worst-month .explanation-card:hover {
    border-color: rgba(244, 67, 54, 0.6);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.2);
    transform: translateY(-3px);
}

.worst-month .explanation-card h3 {
    color: #ef5350;
}

.worst-month .explanation-card strong {
    color: #ffab40;
}

/* Worst Month Table Wrapper - CONSISTENT */
.worst-month .portfolio-table-wrapper {
    border: 1px solid rgba(244, 67, 54, 0.4);
    background: rgba(25, 25, 35, 0.9);
    padding: 25px;
    margin-bottom: 30px;
}

.worst-month .portfolio-table-header {
    margin-bottom: 20px;
}

.worst-month .table-nav {
    margin-bottom: 15px;
}

.worst-month .nav-tabs-portfolio {
    gap: 12px;
    margin-bottom: 12px;
}

.worst-month .tab-portfolio {
    padding: 8px 16px;
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ef5350;
    background: rgba(244, 67, 54, 0.2);
    font-size: 0.85rem;
}

.worst-month .table-controls {
    gap: 10px;
}

.worst-month .control-btn-portfolio {
    padding: 6px 14px;
    border: 1px solid rgba(244, 67, 54, 0.4);
    color: #ef5350;
    background: rgba(244, 67, 54, 0.2);
    font-size: 0.8rem;
}

/* Worst Month Highlight - CONSISTENT */
.worst-month-highlight {
    background: linear-gradient(135deg, #e53935, #ef5350);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(244, 67, 54, 0.3);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

/* Worst Month Table - CONSISTENT */
.worst-month .portfolio-table-container {
    border: 1px solid rgba(244, 67, 54, 0.4);
    margin-bottom: 20px;
}

.worst-month .portfolio-table th {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border-bottom: 2px solid rgba(244, 67, 54, 0.4);
    padding: 12px 10px;
}

.worst-month .portfolio-table td {
    padding: 12px 10px;
}

.worst-month .portfolio-row.visible {
    background: rgba(244, 67, 54, 0.1);
    border-left: 2px solid rgba(244, 67, 54, 0.6);
}

/* Worst Month Footer - CONSISTENT */
.worst-month .portfolio-footer-stats {
    margin-top: 25px;
}

.worst-month .footer-stat-grid {
    gap: 15px;
    margin-bottom: 20px;
}

.worst-month .footer-stat-item {
    background: rgba(25, 25, 35, 0.8);
    border: 1px solid rgba(244, 67, 54, 0.3);
    padding: 16px;
}

.worst-month .footer-stat-item:hover {
    border-color: rgba(244, 67, 54, 0.6);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

.worst-month .stat-label-portfolio {
    color: #ef5350;
}

/* Worst Month Transactions - CONSISTENT */
.worst-month .portfolio-transactions {
    background: rgba(25, 25, 35, 0.8);
    border: 1px solid rgba(244, 67, 54, 0.2);
    padding: 16px;
}

.worst-month .transactions-note-portfolio {
    color: #ef5350;
    margin-bottom: 12px;
}

.worst-month .transaction-buttons {
    gap: 15px;
}

.worst-month .transaction-btn-portfolio {
    padding: 10px 20px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ef5350, #d32f2f);
}

.worst-month .transaction-btn-portfolio:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
}

/* Worst Month CTA - CONSISTENT */
.worst-month .showcase-bottom-cta {
    background: rgba(25, 25, 35, 0.8);
    border: 1px solid rgba(244, 67, 54, 0.3);
    padding: 30px 25px;
    margin-top: 35px;
}

.worst-month .bottom-cta-text {
    margin-bottom: 20px;
}

/* Active States */
.worst-month .tab-portfolio.active {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    border-color: #e53935;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.worst-month .tab-portfolio:hover:not(.active) {
    background: rgba(244, 67, 54, 0.3);
    border-color: #ef5350;
}

.worst-month .control-btn-portfolio:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #ef5350;
}

.worst-month .control-btn-portfolio.date {
    background: rgba(255, 171, 64, 0.2);
    border-color: #ffab40;
    color: #ffab40;
}

/* Colors */
.worst-month .portfolio-positive {
    color: #ffab40 !important;
}

.worst-month .portfolio-negative {
    color: #ef5350 !important;
    font-weight: 600;
}

.worst-month .showcase-title {
    color: #ef5350;
    text-shadow: 0 2px 10px rgba(244, 67, 54, 0.3);
}

.worst-month .table-title {
    color: #ef5350;
}

/* Responsive Design - IMPROVED */
@media (max-width: 768px) {
    .portfolio-showcase-section,
    .portfolio-showcase-section.worst-month {
        padding: 40px 0;
    }
    
    .showcase-title {
        font-size: 1.8rem;
    }
    
    .showcase-subtitle {
        font-size: 1rem;
    }
    
    .showcase-explanation {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .portfolio-table-wrapper {
        padding: 18px;
    }
    
    .nav-tabs-portfolio {
        gap: 8px;
    }
    
    .tab-portfolio {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .table-controls {
        gap: 6px;
    }
    
    .control-btn-portfolio {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .footer-stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .transaction-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .portfolio-table th,
    .portfolio-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
    
    .best-month-highlight,
    .worst-month-highlight {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .showcase-title {
        font-size: 1.6rem;
    }
    
    .best-month-highlight,
    .worst-month-highlight {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .bottom-cta-text {
        font-size: 0.9rem;
    }
    
    .btn-primary-portfolio {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    
    .explanation-card {
        padding: 15px;
    }
    
    .portfolio-table-wrapper {
        padding: 15px;
    }
}

/* Dekorative skrå linjer for worst month section */
.portfolio-showcase-section.worst-month::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 0%, transparent 48%, rgba(255, 171, 64, 0.05) 49%, rgba(255, 171, 64, 0.05) 51%, transparent 52%, transparent 100%),
        linear-gradient(-45deg, transparent 0%, transparent 48%, rgba(239, 83, 80, 0.04) 49%, rgba(239, 83, 80, 0.04) 51%, transparent 52%, transparent 100%);
    background-size: 80px 80px, 120px 120px;
    background-position: 0 0, 40px 40px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

/* Dekorative skrå linjer for best month section */
.portfolio-showcase-section:not(.worst-month)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, transparent 0%, transparent 48%, rgba(0, 188, 212, 0.04) 49%, rgba(0, 188, 212, 0.04) 51%, transparent 52%, transparent 100%),
        linear-gradient(-45deg, transparent 0%, transparent 48%, rgba(76, 175, 80, 0.03) 49%, rgba(76, 175, 80, 0.03) 51%, transparent 52%, transparent 100%);
    background-size: 100px 100px, 140px 140px;
    background-position: 0 0, 50px 50px;
    pointer-events: none;
    opacity: 0.2;
    z-index: 0;
}

/* Sikre at innhold er over dekorasjonene */
.portfolio-showcase-section .container {
    position: relative;
    z-index: 2;
}

/* Ekstra subtile dekorative elementer for table wrapper */
.portfolio-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.02) 31%, rgba(255, 255, 255, 0.02) 33%, transparent 34%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Subtile dekorative cirkler i footer stats */
.footer-stat-item::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* Dekorative linjer i explanation cards */
.explanation-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

/* Mobile responsiv - mindre dekorasjoner på små skjermer */
@media (max-width: 768px) {
    .portfolio-showcase-section.worst-month::after,
    .portfolio-showcase-section:not(.worst-month)::after {
        background-size: 60px 60px, 80px 80px;
        opacity: 0.15;
    }
    
    .portfolio-table-wrapper::after {
        width: 60px;
        height: 60px;
    }
}