/* Clinical Keywords Report Stylesheet */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
}

/* Report container */
.report-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header styles */
.report-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    color: white;
    padding: 30px 40px;
}

.report-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.report-metadata {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.95rem;
    opacity: 0.9;
}

.timestamp {
    display: flex;
    align-items: center;
}

.timestamp::before {
    content: "🕒";
    margin-right: 8px;
}

.total-count {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.total-count::before {
    content: "📊";
    margin-right: 8px;
}

.archive-link {
    color: #87ceeb;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.archive-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

/* Report data section */
.report-data {
    padding: 0;
}

/* Table styles */
.keywords-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Table header */
.table-header {
    background: #f1f3f4;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-row th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8eaed;
}

/* Column specific widths */
.col-guid {
    width: 25%;
    min-width: 280px;
}

.col-kyruus-id {
    width: 12%;
    min-width: 100px;
}

.col-title {
    width: 43%;
    min-width: 200px;
}

.col-category {
    width: 20%;
    min-width: 120px;
}

/* Table body */
.table-body {
    background: white;
}

.data-row {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e8eaed;
}

.data-row:hover {
    background-color: #f8f9fa;
}

.data-row:nth-child(even) {
    background-color: #fafbfc;
}

.data-row:nth-child(even):hover {
    background-color: #f1f3f4;
}

/* Table cells */
.data-row td {
    padding: 14px 20px;
    vertical-align: top;
    border-right: 1px solid #f1f3f4;
}

.data-row td:last-child {
    border-right: none;
}

/* Cell specific styles */
.cell-guid {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #5f6368;
    background-color: #fafbfc;
    word-break: break-all;
}

.cell-kyruus-id {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: #1565c0;
    background-color: #e3f2fd;
    text-align: center;
}

.cell-title {
    font-weight: 500;
    color: #202124;
    line-height: 1.4;
}

.cell-category {
    font-weight: 500;
    text-align: center;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category color coding */
.data-row td.cell-category {
    position: relative;
}

.data-row:has(.cell-category:contains("Condition")) .cell-category,
.data-row .cell-category[data-category="Condition"] {
    background-color: #fce4ec;
    color: #ad1457;
    border: 1px solid #f8bbd9;
}

.data-row:has(.cell-category:contains("Treatment")) .cell-category,
.data-row .cell-category[data-category="Treatment"] {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.data-row:has(.cell-category:contains("Procedure")) .cell-category,
.data-row .cell-category[data-category="Procedure"] {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.data-row:has(.cell-category:contains("Medication")) .cell-category,
.data-row .cell-category[data-category="Medication"] {
    background-color: #e1f5fe;
    color: #0277bd;
    border: 1px solid #b3e5fc;
}

/* Default category style */
.cell-category {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Responsive design */
@media (max-width: 1200px) {
    .report-container {
        margin: 0 10px;
    }
    
    .report-header {
        padding: 20px 30px;
    }
    
    .report-title {
        font-size: 2rem;
    }
    
    .keywords-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .report-header {
        padding: 20px;
    }
    
    .report-title {
        font-size: 1.8rem;
    }
    
    .report-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .keywords-table {
        font-size: 0.8rem;
    }
    
    .header-row th,
    .data-row td {
        padding: 12px 15px;
    }
    
    .col-guid {
        min-width: 200px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .report-container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .report-header {
        background: #2c5aa0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .data-row:hover {
        background-color: transparent;
    }
    
    .archive-link {
        display: none;
    }
}

/* Loading state (optional) */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
