/* Specialties 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 */
.specialties-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 - adjusted for specialties table */
.col-guid {
    width: 20%;
    min-width: 280px;
}

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

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

.col-category {
    width: 10%;
    min-width: 80px;
}

.col-aliases {
    width: 35%;
    min-width: 250px;
}

/* 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-size: 0.85rem;
    color: #9e9e9e;
    font-style: italic;
    text-align: center;
}

.cell-aliases {
    font-size: 0.85rem;
    color: #5f6368;
    line-height: 1.5;
    word-wrap: break-word;
    max-width: 0; /* Forces text wrapping */
}

/* Style for empty category cells */
.cell-category:empty::after {
    content: "—";
    color: #bdbdbd;
}

/* Style for empty aliases cells */
.cell-aliases:empty::after {
    content: "No aliases";
    color: #bdbdbd;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 1200px) {
    .report-container {
        margin: 0 10px;
    }

    .report-header {
        padding: 20px 30px;
    }

    .report-title {
        font-size: 2rem;
    }

    .specialties-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;
    }

    .specialties-table {
        font-size: 0.8rem;
    }

    .header-row th,
    .data-row td {
        padding: 12px 15px;
    }

    .col-guid {
        min-width: 200px;
    }

    .col-aliases {
        min-width: 180px;
    }
}

/* Extra small screens - stack table content */
@media (max-width: 600px) {
    .specialties-table,
    .header-row,
    .table-body,
    .data-row,
    .header-row th,
    .data-row td {
        display: block;
    }

    .table-header {
        display: none;
    }

    .data-row {
        border: 1px solid #e8eaed;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 0;
        background: white;
    }

    .data-row td {
        border-right: none;
        border-bottom: 1px solid #f1f3f4;
        position: relative;
        padding-left: 120px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

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

    .data-row td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 90px;
        font-weight: 600;
        color: #5f6368;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cell-guid:before { content: "GUID"; }
    .cell-kyruus-id:before { content: "Kyruus ID"; }
    .cell-title:before { content: "Title"; }
    .cell-category:before { content: "Category"; }
    .cell-aliases:before { content: "Aliases"; }

    .cell-guid,
    .cell-kyruus-id {
        background-color: transparent;
    }

    .cell-kyruus-id {
        text-align: left;
    }
}

/* 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;
    }

    .cell-aliases {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* 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); }
}
