/* styles/pages/reports.css */

/* === My Reports Specific Styles === */
/* Header bar for sections like My Reports */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--theme-border);
}

.section-header-bar h2 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.4rem;
}

.section-header-bar .report-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

/* Styling for the report list sections */
.report-list-section {
    margin-bottom: 2.5rem;
}

.report-list-section h3 {
    font-size: 1.1rem;
    color: var(--theme-text);
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-list-section h3 i {
    color: var(--theme-text-secondary);
}

/* Container for each list */
.report-list-container {
    padding: 10px;
    border: 1px solid var(--theme-border-color);
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: var(--theme-bg-secondary);
}

/* Placeholder text style */
.report-list-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--theme-text-secondary);
    font-style: italic;
}

.report-group-header {
    margin-top: 15px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--theme-interactive);
    color: var(--theme-text-primary);
    font-size: 1.1em;
    font-weight: 600;
}

.report-list-container .report-group-header:first-of-type {
    margin-top: 0;
}

/* Individual report item styling */
.report-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
        "title date actions"
        "status status actions";
    gap: 4px 12px;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--theme-border-color-light);
}

.report-item:last-child {
    border-bottom: none;
}

.report-item:hover {
    background-color: var(--theme-section-hover-bg);
}

/* Grid area assignments */
.report-item-title {
    grid-area: title;
    font-weight: 500;
    color: var(--theme-text-primary);
}

.report-item-date {
    grid-area: date;
    font-size: 0.85em;
    color: var(--theme-text-secondary);
    text-align: right;
    white-space: nowrap;
}

.report-item-status {
    grid-area: status;
    font-size: 0.8em;
    font-style: italic;
    color: var(--theme-neutral);
    min-height: 1em;
}

.report-item-actions {
    grid-area: actions;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

/* Report item price */
.report-item-price {
    color: var(--theme-text-secondary);
    font-size: 0.9em;
    margin-right: 5px;
    white-space: nowrap;
}

/* Report Viewer */
.report-viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--theme-background);
    z-index: 2000;
    overflow: hidden;
    display: none;
}

.report-viewer-container h3 {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;
    font-size: 1.4rem;
    color: var(--theme-text);
    z-index: 2001;
}

.close-report-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--theme-text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 12px;
    line-height: 1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.close-report-btn:hover {
    background: rgba(255, 61, 113, 0.2);
    border-color: rgba(255, 61, 113, 0.4);
    color: var(--theme-bearish);
    transform: scale(1.05);
}

.report-content-area {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 80px 40px 40px 40px;
    box-sizing: border-box;
    background-color: var(--theme-background);
    scrollbar-width: thin;
    scrollbar-color: var(--theme-accent) rgba(0,0,0,0.1);
}

.report-content-area::-webkit-scrollbar { 
    width: 8px; 
}

.report-content-area::-webkit-scrollbar-track { 
    background: rgba(0,0,0,0.1); 
    border-radius: 4px;
}

.report-content-area::-webkit-scrollbar-thumb { 
    background-color: var(--theme-accent); 
    border-radius: 4px; 
}

.report-content-area::-webkit-scrollbar-thumb:hover {
    background-color: #3a80d2;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .report-content-area {
        padding: 70px 20px 20px 20px;
    }

    .report-item {
        grid-template-columns: 1fr auto;
        grid-template-areas: 
            "title  actions"
            "date   actions"
            "status actions";
        gap: 0.2rem 1rem;
    }

    .report-item-date, 
    .report-item-status { 
        text-align: left; 
    }

    .section-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .section-header-bar h2 {
        font-size: 1.3rem;
    }

    .report-item-actions button {
        padding: 0.4rem 0.9rem;
    }

    .report-item-actions .download-report-btn {
        padding: 0.4rem 0.7rem;
    }
}

/* === Market Pulse Specific Styles === */
.mp-report-tabs {
    display: flex;
    border-bottom: 1px solid var(--theme-border);
    margin-bottom: 20px;
    gap: 0;
}

.mp-tab-button {
    padding: 10px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--theme-text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.mp-tab-button:hover {
    color: var(--theme-text);
    background-color: rgba(74, 144, 226, 0.1);
}

.mp-tab-button.active {
    color: var(--theme-accent);
    border-bottom-color: var(--theme-accent);
    font-weight: 600;
}

.mp-tab-content {
    /* Styles for the content container if needed */
}

.mp-tab-pane {
    display: none;
}

.mp-tab-pane.active {
    display: block;
}

.mp-report-list {
    min-height: 200px;
}

.mp-list-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--theme-text-secondary);
    font-style: italic;
    background-color: var(--theme-section-bg);
    border-radius: 4px;
    border: 1px dashed var(--theme-border);
}

.mp-report-item {
    background-color: var(--theme-section-bg);
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mp-report-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    border-color: var(--theme-accent);
}

.mp-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mp-report-period {
    font-weight: 600;
    color: var(--theme-text);
    font-size: 1.05rem;
}

.mp-report-date {
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
}

.mp-report-summary {
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-modal-overlay {
    display: none;
    position: fixed;
    z-index: 2001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.mp-modal-overlay.visible {
    display: flex;
}

.mp-modal-content {
    background-color: var(--theme-background);
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mp-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--theme-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--theme-section-bg);
}

.mp-modal-header h3 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.3rem;
}

.mp-close-modal {
    background: none;
    border: none;
    color: var(--theme-text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.mp-close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--theme-text);
}

.mp-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: var(--theme-section-bg);
}

/* Delete report buttons */
.mp-report-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mp-report-item {
    position: relative;
}

.mp-report-item:hover .mp-report-actions {
    opacity: 1;
}

.delete-report-btn {
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.3);
    color: var(--theme-bearish);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-report-btn:hover {
    background: rgba(255, 61, 113, 0.2);
    border-color: var(--theme-bearish);
    transform: scale(1.1);
}

.delete-report-btn:active {
    transform: scale(1);
}

.delete-all-reports-btn {
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.3);
    color: var(--theme-bearish);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-all-reports-btn:hover {
    background: rgba(255, 61, 113, 0.2);
    border-color: var(--theme-bearish);
    transform: translateY(-1px);
}

.delete-all-reports-btn:active {
    transform: translateY(0);
}

.delete-all-reports-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mp-delete-all-container {
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--theme-border);
}

/* Report card styles */
.report-card {
    background-color: var(--theme-section-bg);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 16px;
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.report-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--theme-text);
    line-height: 1.2;
}

.card-body {
    margin-bottom: 8px;
}

.card-analysis {
    font-size: 0.9rem;
    color: var(--theme-text-secondary);
    display: block;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-date {
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-price {
    font-size: 0.85rem;
    color: var(--theme-text-secondary);
    margin-right: 4px;
}

.card-btn-primary {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    min-height: 32px;
}

.card-btn-icon {
    padding: 6px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
    min-width: 32px;
    min-height: 32px;
}

.card-status {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--theme-neutral);
    margin: 4px 0;
    min-height: 1em;
    display: block;
}

/* Mobile responsive for cards */
@media (max-width: 768px) {
    .report-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .card-header {
        margin-bottom: 6px;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}