/* UCSF Migration 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;
}

/* Container */
.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-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.timestamp {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.timestamp::before {
    content: "🕒";
    margin-right: 8px;
}

.summary {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.summary::before {
    content: "📊";
    margin-right: 8px;
}

/* Report content */
.report-content {
    padding: 0;
}

/* Migration table */
.migration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Table header */
.migration-table thead {
    background: #f1f3f4;
    position: sticky;
    top: 0;
    z-index: 10;
}

.migration-table 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 widths */
.status-col { width: 12%; min-width: 120px; }
.service-col { width: 20%; min-width: 180px; }
.migration-col { width: 12%; min-width: 100px; }
.new-url-col { width: 25%; min-width: 200px; }
.source-urls-col { width: 25%; min-width: 200px; }
.url-check-col { width: 6%; min-width: 80px; }

/* Table rows */
.migration-table tbody {
    background: white;
}

.migration-table tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e8eaed;
}

.migration-table tr:hover {
    background-color: #f8f9fa;
}

.migration-table tr:nth-child(even) {
    background-color: #fafbfc;
}

.migration-table tr:nth-child(even):hover {
    background-color: #f1f3f4;
}

/* Row types */
.migrated-row {
    border-left: 4px solid #34a853;
}

.pending-row {
    border-left: 4px solid #fbbc04;
}

/* Table cells */
.migration-table td {
    padding: 14px 20px;
    vertical-align: top;
    border-right: 1px solid #f1f3f4;
}

.migration-table td:last-child {
    border-right: none;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-rewrite {
    background-color: #fef7e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.status-migrate {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-minor {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #2196f3;
}

.status-other {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #9c27b0;
}

.status-unknown {
    background-color: #f5f5f5;
    color: #757575;
    border: 1px solid #bdbdbd;
}

/* Service name */
.service-name {
    font-weight: 500;
    color: #202124;
    line-height: 1.4;
}

/* Migration type */
.migration-type {
    font-size: 0.85rem;
    color: #5f6368;
}

/* New URL cell */
.new-url a {
    color: #1565c0;
    text-decoration: none;
    word-break: break-all;
    font-size: 0.85rem;
}

.new-url a:hover {
    text-decoration: underline;
}

.new-url .pending {
    color: #9e9e9e;
    font-style: italic;
    font-size: 0.85rem;
}

/* Source URLs */
.source-url-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.source-url-list li {
    margin-bottom: 6px;
}

.source-url-list li:last-child {
    margin-bottom: 0;
}

.source-url-list a {
    color: #5f6368;
    text-decoration: none;
    font-size: 0.8rem;
    word-break: break-all;
    display: block;
    padding: 2px 0;
}

.source-url-list a:hover {
    color: #1565c0;
    text-decoration: underline;
}

.no-sources {
    color: #bdbdbd;
    font-style: italic;
    font-size: 0.8rem;
}

/* URL check status */
.url-check {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.url-live {
    color: #2e7d32;
}

.url-error {
    color: #d32f2f;
}

.url-pending {
    color: #9e9e9e;
    font-style: italic;
}

/* Footer */
.report-footer {
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    text-align: center;
    color: #5f6368;
    font-size: 0.85rem;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        margin: 0 10px;
    }

    .report-header {
        padding: 20px 30px;
    }

    .report-header h1 {
        font-size: 2rem;
    }

    .migration-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .report-header {
        padding: 20px;
    }

    .report-header h1 {
        font-size: 1.8rem;
    }

    .migration-table {
        font-size: 0.8rem;
    }

    .migration-table th,
    .migration-table td {
        padding: 12px 15px;
    }

    .status-col { min-width: 100px; }
    .service-col { min-width: 150px; }
    .new-url-col { min-width: 180px; }
    .source-urls-col { min-width: 180px; }
}

/* Mobile stacked layout */
@media (max-width: 600px) {
    .migration-table,
    .migration-table thead,
    .migration-table tbody,
    .migration-table th,
    .migration-table td,
    .migration-table tr {
        display: block;
    }

    .migration-table thead tr {
        display: none;
    }

    .migration-table tr {
        border: 1px solid #e8eaed;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 0;
        background: white;
    }

    .migration-table td {
        border-right: none;
        border-bottom: 1px solid #f1f3f4;
        position: relative;
        padding-left: 140px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .migration-table td:last-child {
        border-bottom: none;
    }

    .migration-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 110px;
        font-weight: 600;
        color: #5f6368;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .status-cell:before { content: "Status"; }
    .service-name:before { content: "Service"; }
    .migration-type:before { content: "Migration"; }
    .new-url:before { content: "New URL"; }
    .source-urls:before { content: "Source URLs"; }
    .url-check:before { content: "URL Check"; }

    .url-check {
        text-align: left;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .report-header {
        background: #2c5aa0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    .migration-table tr:hover {
        background-color: transparent;
    }

    .source-url-list a {
        font-size: 0.7rem;
    }

    .status-badge {
        font-size: 0.7rem;
    }
}