/* 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;
    overflow-x: hidden;
    color: #333;
    background-color: #ffffff;
}

/* Header Styles */
.header {
    background-color: #1a3a6e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s, opacity 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-links a.active {
    background-color: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Layout Helpers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-title {
    text-align: center;
    color: #1a3a6e;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.page-title-left {
    text-align: left;
}

/* Home Page Styles */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.home-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.home-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.about-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.about-logo {
    height: 50px;
    width: auto;
}

.about-header h1 {
    color: #1a3a6e;
    font-size: 2rem;
    font-weight: bold;
}

.about-item {
    margin-bottom: 2rem;
}

.about-item h3 {
    color: #1a3a6e;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.about-item p {
    margin-bottom: 1rem;
    text-align: justify;
}

.link {
    color: #1a3a6e;
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.link-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.visualization-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.viz-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.viz-item h3 {
    color: #1a3a6e;
    margin-bottom: 1rem;
    text-align: center;
}

.viz-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Resources Page Styles */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.resource-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

.resource-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resource-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.resource-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: #1a3a6e;
    color: white;
}

.btn-primary:hover {
    background-color: #2d4a7a;
}

.btn-secondary {
    background-color: white;
    color: #1a3a6e;
    border: 1px solid #1a3a6e;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
}

/* Disabled button styles */
.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: #8a9ab8;
    color: #ffffff;
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
    background-color: #f0f0f0;
    color: #999999;
    border-color: #cccccc;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    background-color: #8a9ab8;
}

.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
    background-color: #f0f0f0;
    color: #999999;
}

/* Sample Info Page Styles */
.sample-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.sample-item {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.sample-item h3 {
    color: #1a3a6e;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
}

.chart-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.chart-link {
    color: #1a3a6e;
    text-decoration: none;
}

.chart-link:hover {
    text-decoration: underline;
}

.note {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    text-align: center;
}

/* DE Protein Page Styles */
.de-protein-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-section {
    display: flex;
    gap: 0.5rem;
}

.total-count {
    font-weight: 600;
}

.search-input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.error-message {
    color: red;
}

.table-container {
    overflow-x: unset;
}

.protein-table {
    width: 100%;
    border-collapse: collapse;
}

.protein-table th,
.protein-table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: left;
}

.protein-table th {
    background: #f8f9fa;
}

.pagination {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sort-btn .arrow {
    font-size: 0.75rem;
}

/* Contact Page Styles */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item h3 {
    color: #1a3a6e;
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: #1a3a6e;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-form .form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Footer Styles */
.footer {
    background-color: #1a3a6e;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-section {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.footer-section p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.footer-section strong {
    font-weight: 600;
    color: #ffffff;
}

.footer-section a {
    color: #87ceeb;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .home-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .resources-grid,
    .sample-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-section {
        min-width: auto;
        max-width: none;
    }

    .chart-links,
    .resource-buttons {
        flex-direction: column;
        align-items: center;
    }

    .de-protein-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Phos Page Specific Styles */
.manhattan-link-section {
    margin: 1rem 0;
}

.phos-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    min-width: 150px;
}

.filter-input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 150px;
}

.total-count {
    font-weight: 500;
    color: #666;
    margin-top: 0.5rem;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
    display: none;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.page-info {
    font-weight: 500;
    color: #666;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #007bff;
    color: #007bff;
}

.btn-outline:hover {
    background-color: #007bff;
    color: white;
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline:disabled:hover {
    background-color: transparent;
    color: #007bff;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Table hover effects */
.protein-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Sorting functionality styles */
.sort-btn {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.sort-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sort-btn.active-sort {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
    font-weight: 600;
}

.sort-btn .arrow {
    font-size: 0.8rem;
    margin-left: 0.5rem;
    min-width: 12px;
    text-align: center;
}

.protein-table th {
    padding: 0;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.protein-table th:hover {
    background-color: #e9ecef;
}

/* DataTables customization */
.dataTables_wrapper {
    margin-top: 1rem;
}

.dataTables_length,
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_info {
    padding-top: 0.5rem;
}

.table-hover-highlight {
    background-color: #f8f9fa !important;
}

/* DataTables sorting arrows */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before {
    right: 1em;
    content: "↕";
    opacity: 0.5;
}

table.dataTable thead .sorting_asc:before {
    content: "↑";
    opacity: 1;
}

table.dataTable thead .sorting_desc:before {
    content: "↓";
    opacity: 1;
}

/* Custom DataTables styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #007bff;
    color: white !important;
    border: 1px solid #007bff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef;
    color: #495057 !important;
    border: 1px solid #dee2e6;
}

/* Responsive table adjustments */
.table-container {
    overflow-x: auto;
}

#phosTable {
    width: 100% !important;
}

#phosTable th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

#phosTable td {
    vertical-align: middle;
}

/* Responsive adjustments for phos page */
@media (max-width: 768px) {
    .phos-controls {
        padding: 1rem;
    }
    
    .search-section,
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select,
    .filter-input {
        min-width: auto;
        width: 100%;
    }
    
    .dataTables_length,
    .dataTables_filter {
        text-align: center;
    }
    
    .dataTables_info,
    .dataTables_paginate {
        text-align: center;
        margin-top: 1rem;
    }
}
