/**
 * Mini PWAT Styles
 */

/* Main Container - Cross-browser font stack */
.mini-pwat-admin,
.mini-pwat-frontend {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mini-pwat-container {
    max-width: 1200px;
    margin: 20px 0;
}

/* Card Styles */
.mini-pwat-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.mini-pwat-card h2 {
    margin-top: 0;
    color: #1d2327;
    font-size: 24px;
    font-weight: 600;
}

.mini-pwat-card h3 {
    color: #1d2327;
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
}

.mini-pwat-card h4 {
    color: #2271b1;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.mini-pwat-card p {
    color: #50575e;
    line-height: 1.6;
}

/* Form Styles - Cross-browser compatible */
.form-group {
    margin-bottom: 20px;
    display: block; /* Ensure proper block display in all browsers */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
    font-weight: 500;
}

.form-group label .description {
    display: block;
    font-weight: 400;
    font-size: 13px;
    color: #646970;
    margin-top: 4px;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.form-group textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
    -moz-box-shadow: 0 0 0 1px #2271b1; /* Firefox */
    -webkit-box-shadow: 0 0 0 1px #2271b1; /* Safari/Chrome */
}

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.form-group select:focus,
.form-group input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Note Input Wrapper */
.note-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.note-input-wrapper input[type="text"] {
    flex: 1;
    max-width: none;
}

.play-notes-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.play-notes-btn .dashicons {
    line-height: inherit;
    vertical-align: middle;
    margin-right: 4px;
}

/* File Upload Input */
.fasta-file-input {
    display: inline-block;
    padding: 8px 12px;
    border: 2px dashed #8c8f94;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    width: auto;
    max-width: 100%;
}

.fasta-file-input:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.fasta-file-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.load-example-btn {
    margin-left: 10px;
    vertical-align: middle;
}

.load-example-btn .dashicons {
    line-height: inherit;
    vertical-align: middle;
    margin-right: 4px;
}

/* File Info Display */
.file-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    font-size: 13px;
    color: #1d2327;
    display: none;
}

.file-info:not(:empty) {
    display: block;
}

.file-info .dashicons {
    color: #2271b1;
    vertical-align: middle;
}

/* Form Divider */
.form-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #dcdcde;
}

.form-divider span {
    position: relative;
    display: inline-block;
    padding: 0 15px;
    background: #fff;
    color: #646970;
    font-weight: 600;
    font-size: 13px;
    z-index: 1;
}

/* Button Styles */
.button-large {
    font-size: 14px !important;
    height: auto !important;
    padding: 10px 24px !important;
}

.button .dashicons {
    line-height: inherit;
    vertical-align: middle;
    margin-right: 4px;
}

.spinner {
    float: none;
    margin: 0 0 0 10px;
    vertical-align: middle;
}

/* Results Styles */
#results-section {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-summary {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.results-summary p {
    margin: 5px 0;
    font-size: 14px;
}

.no-results {
    background: #fcf9e8;
    border-left: 4px solid #dba617;
    padding: 15px 20px;
    border-radius: 4px;
}

.error-message {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 15px 20px;
    border-radius: 4px;
    color: #3c434a;
}

/* Result Items */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 15px 20px;
    background: #f9f9f9;
    transition: box-shadow 0.2s;
}

.result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Match Statistics */
.match-statistics {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.match-statistics span {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.match-score {
    background: #f0f0f1;
    color: #1d2327;
}

.match-score.score-high {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.match-score.score-medium {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.match-score.score-low {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.match-probability,
.match-evalue,
.match-length {
    background: #f0f6fc;
    color: #1e40af;
    border: 1px solid #3b82f6;
    font-family: 'Courier New', monospace;
}

.result-details p {
    margin: 8px 0;
    font-size: 14px;
}

.result-details code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.matched-notes {
    color: #2271b1;
    font-weight: 600;
    font-size: 14px;
}

/* Protein Matches Container */
.protein-matches {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.protein-matches h5 {
    margin: 0 0 15px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 8px;
}

.single-match {
    padding: 12px;
    margin: 12px 0;
    background: #f9f9f9;
    border-left: 4px solid #2271b1;
    border-radius: 3px;
}

.single-match:first-child {
    margin-top: 0;
}

.single-match p {
    margin: 6px 0;
}

.match-individual-stats {
    color: #646970;
    font-size: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dcdcde;
}

/* Context Display */
.context-display {
    margin-top: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.sequence-context {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
    word-break: break-all;
    margin-top: 8px;
}

.context-before {
    color: #646970;
}

.context-match {
    background: #fffbcc;
    color: #1d2327;
    font-weight: 600;
    padding: 2px 0;
    border-bottom: 2px solid #dba617;
}

.context-after {
    color: #646970;
}

/* Mapping Table */
.mapping-table-container {
    margin-top: 15px;
    overflow-x: auto;
}

.mapping-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    font-size: 13px;
}

.mapping-table thead {
    background: #f0f0f1;
}

.mapping-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dcdcde;
}

.mapping-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #dcdcde;
}

.mapping-table tbody tr:hover {
    background: #f9f9f9;
}

.mapping-table code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Help Section */
.mini-pwat-help {
    background: #f6f7f7;
}

.mini-pwat-help ol,
.mini-pwat-help ul {
    margin-left: 20px;
    line-height: 1.8;
}

.mini-pwat-help li {
    margin-bottom: 8px;
    color: #50575e;
}

.mini-pwat-help code {
    background: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid #dcdcde;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Function Information Styles */
.function-info {
    margin-top: 12px;
    padding: 12px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    font-size: 13px;
    color: #1d2327;
}

.function-info p {
    margin: 0;
    line-height: 1.6;
}

/* Disease Information Styles */
.disease-info {
    margin-top: 12px;
    padding: 12px;
    background: #fff4e6;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

.disease-info ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.disease-info li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.disease-description {
    color: #646970;
    font-size: 13px;
}

/* Pathway Information Styles */
.pathway-info {
    margin-top: 12px;
    padding: 12px;
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    border-radius: 4px;
}

.pathway-info ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.pathway-info li {
    margin-bottom: 6px;
    line-height: 1.6;
    font-size: 13px;
    color: #1d2327;
}

/* No Information Available */
.disease-info-none {
    margin-top: 12px;
    padding: 12px;
    background: #f6f7f7;
    border-left: 4px solid #c3c4c7;
    border-radius: 4px;
    font-size: 13px;
    color: #646970;
}

.disease-info-none p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mini-pwat-card {
        padding: 15px 20px;
    }
    
    .form-group select,
    .form-group input[type="text"] {
        max-width: 100%;
    }
    
    .mapping-table {
        font-size: 12px;
    }
}

/* Frontend Specific Styles */
.mini-pwat-frontend .mini-pwat-card {
    border: 1px solid #e0e0e0;
}

.mini-pwat-frontend .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.mini-pwat-frontend .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

