/**
 * TTT OpenAccess Tracker - Frontend CSS
 */

.openaccess-section {
    margin: 40px 0;
    padding: 30px;
    background: #fff;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.openaccess-title {
    margin: 0 0 30px;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid var(--border);
    padding: 0 0 20px 0;
}

/* DOI Header */
.openaccess-doi-header {
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
}

.openaccess-doi-header a {
    color: #e67e22;
    text-decoration: none;
    word-break: break-all;
}

.openaccess-doi-header a:hover {
    text-decoration: underline;
}

/* Citation Widget */
.openaccess-citation-widget {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.openaccess-citation-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.openaccess-citation-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.openaccess-citation-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    min-width: 180px;
}

.openaccess-citation-select:hover,
.openaccess-citation-select:focus {
    border-color: #e67e22;
    outline: none;
}

.openaccess-citation-output {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    min-height: 60px;
}

.openaccess-citation-text {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.openaccess-citation-text i {
    font-style: italic;
}

.openaccess-citation-text a {
    color: #e67e22;
    word-break: break-all;
}

/* Fallback como_citar */
.openaccess-citar {
    margin-bottom: 30px;
    font-size: 14px;
    color: #555;
}

.openaccess-citar > strong {
    display: block;
    margin-bottom: 8px;
}

.openaccess-citar-content {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #e67e22;
    font-size: 13px;
    line-height: 1.6;
}

/* Tabs */
.openaccess-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.openaccess-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.openaccess-tab:hover {
    border-color: #e67e22;
}

.openaccess-tab.active {
    background: #e67e22;
    border-color: #e67e22;
    color: #fff;
}

/* Content */
.openaccess-content {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.openaccess-metrics {
    flex-shrink: 0;
    width: 180px;
}

.openaccess-metric {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, #e67e22 0%, #d35400 50%, #c0392b 100%);
    border-radius: 8px;
    text-align: center;
    color: #fff;
    min-height: 200px;
}

.openaccess-metric-value {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.openaccess-metric-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

/* Map */
.openaccess-map-wrapper {
    flex: 1;
    min-width: 0;
}

.openaccess-map-title {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

#openaccess-map {
    height: 350px;
    border-radius: 8px;
    background: #aad3df;
}

/* Leyenda dentro del mapa */
.openaccess-map-legend-control {
    background: rgba(255,255,255,0.95);
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font-size: 12px;
}

.openaccess-map-legend-control .openaccess-legend-gradient {
    width: 120px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(90deg, #fdd9b5 0%, #f5a54a 25%, #e67e22 50%, #d35400 75%, #c0392b 100%);
}

.openaccess-map-legend-control .openaccess-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* Popup del mapa */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
}

/* Files */
.openaccess-files {
    margin-bottom: 30px;
}

.openaccess-files-title {
    margin: 0 0 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.openaccess-file-wrapper {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.openaccess-file-wrapper:hover {
    border-color: #e67e22;
}

.openaccess-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    text-decoration: none;
    color: #555;
    transition: background 0.2s;
}

.openaccess-file:hover {
    background: #fafafa;
    color: #333;
}

.openaccess-file-icon {
    flex-shrink: 0;
}

.openaccess-file-info {
    flex: 1;
    min-width: 0;
}

.openaccess-file-title {
    display: block;
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.openaccess-file-subtitle {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 1px;
}

.openaccess-file-doi {
    padding: 8px 14px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #555;
}

.openaccess-file-doi a {
    color: #e67e22;
    text-decoration: none;
    word-break: break-all;
}

.openaccess-file-doi a:hover {
    text-decoration: underline;
}

.openaccess-file-meta {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .openaccess-content {
        flex-direction: column;
    }
    .openaccess-metrics {
        width: 100%;
    }
    #openaccess-map {
        height: 280px;
    }
}
