/**
 * Portfolio X-Ray Styles
 * Phase 3 - Holdings Analytics Feature
 *
 * Features:
 * - Drag & drop upload zone
 * - Progress indicators
 * - Holdings table styling
 * - Activity heatmap
 * - Matching fund cards
 * - Liquid Glass theme integration
 *
 * @version 1.0.0
 */

/* ===== UPLOAD SECTION ===== */

.upload-dropzone {
    border: 2px dashed rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
}

.upload-dropzone:hover {
    border-color: rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    transform: translateY(-2px);
}

.upload-dropzone.drag-over {
    border-color: var(--starlink-cyan);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(124, 58, 237, 0.2));
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-dropzone h4 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.upload-dropzone p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 12px !important;
    font-style: italic;
    opacity: 0.7;
}

.btn-upload {
    background: linear-gradient(135deg, var(--starlink-cyan), var(--starlink-purple));
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
}

/* ===== UPLOAD PROGRESS ===== */

.upload-progress {
    margin-top: 30px;
    padding: 30px;
    border-radius: 16px;
    background: rgba(0, 212, 255, 0.05);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--starlink-cyan), var(--starlink-purple));
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 1.5s infinite;
}

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

.progress-text {
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    margin: 0;
}

/* ===== DEMO MODE ===== */

.demo-mode {
    margin-top: 30px;
    padding-top: 30px;
}

.demo-mode hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.btn-demo {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid var(--starlink-yellow);
    color: var(--starlink-yellow);
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-demo:hover {
    background: rgba(255, 184, 0, 0.2);
    transform: translateY(-1px);
}

/* ===== PORTFOLIO CARDS ===== */

.portfolio-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.portfolio-card:hover {
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.2);
}

.portfolio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.portfolio-card-title {
    color: var(--starlink-cyan);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.portfolio-card-date {
    color: var(--text-muted);
    font-size: 12px;
}

.portfolio-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.portfolio-stat {
    text-align: center;
}

.portfolio-stat-value {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.portfolio-stat-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== HOLDINGS TABLE ===== */

.holdings-table {
    width: 100%;
    border-collapse: collapse;
}

.holdings-table thead {
    background: rgba(0, 212, 255, 0.1);
}

.holdings-table th {
    color: var(--starlink-cyan);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.holdings-table td {
    color: var(--text-primary);
    font-size: 14px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.holdings-table tbody tr {
    transition: background 0.2s ease;
}

.holdings-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

.match-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.match-badge.exact {
    background: rgba(0, 255, 0, 0.2);
    color: var(--starlink-green);
    border: 1px solid var(--starlink-green);
}

.match-badge.fuzzy {
    background: rgba(255, 184, 0, 0.2);
    color: var(--starlink-yellow);
    border: 1px solid var(--starlink-yellow);
}

.match-badge.unmatched {
    background: rgba(255, 51, 51, 0.2);
    color: var(--starlink-red);
    border: 1px solid var(--starlink-red);
}

/* ===== ACTIVITY HEATMAP ===== */

.activity-heatmap {
    display: grid;
    gap: 12px;
}

.activity-row {
    display: grid;
    grid-template-columns: 200px 1fr 120px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.activity-row:hover {
    background: rgba(0, 212, 255, 0.08);
    transform: translateX(4px);
}

.activity-fund-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.activity-bars {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
}

.activity-bar {
    height: 100%;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.activity-bar.buy {
    background: linear-gradient(90deg, var(--starlink-green), rgba(0, 255, 0, 0.6));
}

.activity-bar.sell {
    background: linear-gradient(90deg, var(--starlink-red), rgba(255, 51, 51, 0.6));
}

.activity-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.1);
}

.activity-label {
    color: var(--text-muted);
    font-size: 13px;
    text-align: right;
}

/* ===== MATCHING FUNDS ===== */

.matching-fund-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 58, 237, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.matching-fund-card:hover {
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

.matching-fund-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.matching-fund-name {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.matching-fund-manager {
    color: var(--text-muted);
    font-size: 13px;
}

.overlap-score {
    background: linear-gradient(135deg, var(--starlink-cyan), var(--starlink-purple));
    color: white;
    font-size: 18px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 12px;
}

.matching-fund-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.matching-detail {
    text-align: center;
}

.matching-detail-value {
    color: var(--starlink-cyan);
    font-size: 16px;
    font-weight: 600;
}

.matching-detail-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

/* ===== BUTTONS ===== */

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--starlink-cyan);
    color: var(--starlink-cyan);
}

/* ===== RESPONSIVE ===== */

/* Tablet (iPad) */
@media (max-width: 1024px) and (min-width: 769px) {
    .upload-dropzone {
        padding: 50px 30px;
    }

    .portfolio-card-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .activity-row {
        grid-template-columns: 80px 1fr 120px;
    }

    .matching-fund-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .upload-dropzone {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .portfolio-card-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .activity-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .activity-bars {
        order: 2;
    }

    .activity-label {
        order: 3;
        text-align: left;
    }

    .matching-fund-details {
        grid-template-columns: 1fr;
    }
}

/* ===== EMPTY STATE ===== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}
