/* GRiPS Publications Styles */

/* Summary Statistics */
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color, #2c5282);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Research Areas Grid */
.research-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.area-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.area-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color, #2c5282);
}

.area-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.area-name {
    font-weight: 600;
    color: var(--text-primary, #1a202c);
    margin-bottom: 0.25rem;
}

.area-count {
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
}

/* World Map Section */
.map-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.map-container h3 {
    margin-top: 0;
    color: var(--primary-color, #2c5282);
}

.map-legend {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
}

.country-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.country-bar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.country-name {
    min-width: 150px;
    font-weight: 500;
    color: var(--text-primary, #1a202c);
}

.country-bar-container {
    flex: 1;
    position: relative;
    height: 30px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.country-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, #2c5282), #4299e1);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.country-count {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #1a202c);
    z-index: 1;
}

.map-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
    font-style: italic;
}

/* Publications Table */
.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color, #2c5282);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color, #2c5282);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.table-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.publications-data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.publications-data-table thead {
    background: var(--primary-color, #2c5282);
    color: white;
}

.publications-data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.publications-data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.publications-data-table tbody tr:hover {
    background: #f8fafc;
}

.title-cell {
    max-width: 400px;
    line-height: 1.5;
}

.table-info {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary, #666);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }

    .research-areas-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .area-icon {
        font-size: 2rem;
    }

    .country-name {
        min-width: 100px;
        font-size: 0.9rem;
    }

    .table-controls {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .publications-data-table {
        font-size: 0.9rem;
    }

    .publications-data-table th,
    .publications-data-table td {
        padding: 0.75rem 0.5rem;
    }

    .title-cell {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    /* Stack table for very small screens */
    .publications-data-table thead {
        display: none;
    }

    .publications-data-table,
    .publications-data-table tbody,
    .publications-data-table tr,
    .publications-data-table td {
        display: block;
        width: 100%;
    }

    .publications-data-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
    }

    .publications-data-table td {
        text-align: left;
        padding: 0.75rem;
        position: relative;
        padding-left: 40%;
    }

    .publications-data-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 35%;
        font-weight: 600;
        color: var(--primary-color, #2c5282);
    }

    .title-cell {
        max-width: 100%;
    }

    .country-bar-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .country-name {
        width: 100%;
    }

    .country-bar-container {
        width: 100%;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-box,
.area-box,
.country-bar-item {
    animation: fadeIn 0.5s ease-out forwards;
}

.country-bar-item:nth-child(1) { animation-delay: 0.05s; }
.country-bar-item:nth-child(2) { animation-delay: 0.1s; }
.country-bar-item:nth-child(3) { animation-delay: 0.15s; }
.country-bar-item:nth-child(4) { animation-delay: 0.2s; }
.country-bar-item:nth-child(5) { animation-delay: 0.25s; }
.country-bar-item:nth-child(6) { animation-delay: 0.3s; }
.country-bar-item:nth-child(7) { animation-delay: 0.35s; }
.country-bar-item:nth-child(8) { animation-delay: 0.4s; }
.country-bar-item:nth-child(9) { animation-delay: 0.45s; }
.country-bar-item:nth-child(10) { animation-delay: 0.5s; }
