/* Index Page 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: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

/* Main container */
.main-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

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

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Content area */
.content-area {
    padding: 40px;
}

/* Section styling */
.report-section {
    margin-bottom: 40px;
}

.report-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8eaed;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    border-radius: 2px;
    margin-right: 12px;
}

/* Navigation lists */
.report-list {
    list-style: none;
    display: grid;
    gap: 15px;
}

/* Report links */
.report-link {
    display: block;
    padding: 20px 24px;
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    text-decoration: none;
    color: #202124;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.report-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.report-link:hover {
    background: white;
    border-color: #2c5aa0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.15);
}

.report-link:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.report-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.2);
}

/* Icons for different report types */
.report-link[href*="medical-tests"]::after { content: "🧪"; }
.report-link[href*="services"]::after { content: "⚕️"; }
.report-link[href*="condition"]::after { content: "🏥"; }
.report-link[href*="treatment"]::after { content: "💊"; }
.report-link[href*="clinical_keywords"]::after { content: "🔍"; }
.report-link[href*="specialties"]::after { content: "👨‍⚕️"; }

.report-link::after {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.report-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Responsive design */
@media (min-width: 768px) {
    .report-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stack single items in full width */
    .report-list:has(.report-link:only-child) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

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

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

    .page-subtitle {
        font-size: 1rem;
    }

    .content-area {
        padding: 30px 20px;
    }

    .report-section {
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .report-link {
        padding: 18px 20px;
        font-size: 0.95rem;
    }

    .report-link::after {
        right: 16px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }

    .content-area {
        padding: 20px 15px;
    }

    .report-link {
        padding: 16px 18px;
    }

    .report-link::after {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-left: 10px;
        display: inline;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .main-container {
        box-shadow: none;
        border-radius: 0;
    }

    .page-header {
        background: #2c5aa0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    .report-link {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .report-link::after {
        display: none;
    }

    .report-link:hover {
        transform: none;
        box-shadow: none;
    }
}

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

.loading .report-link {
    background: #f5f5f5;
    color: transparent;
    position: relative;
}

.loading .report-link::before {
    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); }
}

/* Accessibility improvements */
.report-link:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .report-link,
    .report-link::before,
    .report-link::after {
        transition: none;
    }
    
    .loading .report-link::before {
        animation: none;
    }
}
