/**
 * Frontend Styles for Peptide Auto Content
 */

/* Tab Content Container */
.pac-tab-content {
    padding: 20px 0;
}

/* Global link styling for all tab content */
.pac-tab-content a {
    color: #B76E79 !important;
    text-decoration: underline;
}

.pac-tab-content a:hover {
    color: #9A5A63 !important;
    text-decoration: underline;
}

/* What Is Content */
.pac-what-is-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.pac-what-is-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.pac-what-is-content a {
    color: #B76E79 !important;
    text-decoration: underline;
}

.pac-what-is-content a:hover {
    color: #9A5A63 !important;
    text-decoration: underline;
}

/* Structure Content */
.peptide-structure-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.peptide-structure-content h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.structure-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.structure-2d,
.structure-3d {
    text-align: center;
}

.peptide-structure-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #fff;
}

.chemical-properties {
    margin-top: 30px;
}

.peptide-properties-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.peptide-properties-table th,
.peptide-properties-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.peptide-properties-table th {
    font-weight: 600;
    width: 200px;
    background: #f9f9f9;
}

.peptide-properties-table td {
    color: #555;
}

.peptide-properties-table code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    word-break: break-all;
}

/* IUPAC Name Collapsible in Table */
.iupac-collapsible {
    width: 100%;
}

.iupac-toggle-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 12px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    color: #333;
}

.iupac-toggle-btn:hover {
    background: #ebebeb;
    border-color: #ccc;
}

.iupac-toggle-btn.active {
    border-radius: 6px 6px 0 0;
    background: #ebebeb;
}

.iupac-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.75em;
    color: #666;
    margin-left: 10px;
}

.iupac-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.iupac-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    font-size: 0.85em;
    line-height: 1.5;
    word-break: break-word;
    color: #555;
}

.iupac-content.show {
    max-height: 500px;
    padding: 12px;
    overflow-y: auto;
}

.pubchem-link {
    margin-top: 15px;
}

.pubchem-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

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

/* Research Content */
.peptide-research-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.research-intro {
    margin-bottom: 25px;
    font-size: 1.05em;
    color: #555;
}

.research-articles {
    margin-bottom: 30px;
}

.research-article {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.research-article:last-child {
    border-bottom: none;
}

.article-title {
    margin: 0 0 10px;
    font-size: 1.1em;
    line-height: 1.4;
}

.article-title a {
    color: #0073aa;
    text-decoration: none;
}

.article-title a:hover {
    text-decoration: underline;
}

.article-citation {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

.article-citation em {
    font-style: italic;
}

.article-citation a {
    color: #0073aa;
    text-decoration: none;
}

.article-citation a:hover {
    text-decoration: underline;
}

.research-disclaimer {
    background: #fff9e6;
    border: 1px solid #ffd700;
    border-radius: 4px;
    padding: 15px;
    margin-top: 30px;
}

.research-disclaimer p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

/* Collapsible sections */
.pac-collapsible-section {
    margin: 15px 0;
}

.pac-toggle-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 12px 15px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.pac-toggle-btn.active {
    border-radius: 8px 8px 0 0 !important;
}

.pac-toggle-btn:hover {
    background: #ebebeb;
    border-color: #ccc;
}

.pac-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8em;
    color: #666;
}

.pac-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}


.pac-toggle-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.pac-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.pac-collapsible-content.show {
    max-height: 2000px;
    padding: 15px;
}

.pac-collapsible-content p {
    margin: 0;
    word-break: break-word;
    line-height: 1.6;
}

.pac-collapsible-content a {
    color: #B76E79 !important;
    text-decoration: underline;
}

.pac-collapsible-content a:hover {
    color: #9A5A63 !important;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .structure-images {
        grid-template-columns: 1fr;
    }

    .peptide-properties-table th {
        width: 150px;
    }

    .peptide-properties-table th,
    .peptide-properties-table td {
        padding: 10px;
        font-size: 0.95em;
    }

    .pac-toggle-btn {
        font-size: 0.95em;
        padding: 10px 12px;
    }
}
