/* Minimalistic Research Data Viewer - Apple Style */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #1d1d1f;
    background-color: #fbfbfd;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    padding: 40px 0 20px;
    border-bottom: 1px solid #e5e5e7;
    margin-bottom: 30px;
}

header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1f;
}

header p {
    color: #86868b;
    font-size: 16px;
    font-weight: 400;
}

/* Model Workflow Section */
.model-workflow-section {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.workflow-btn-simple {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #007aff;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.2);
}

.workflow-btn-simple:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

.workflow-btn-simple svg {
    transition: transform 0.3s ease;
}

.workflow-btn-simple:hover svg {
    transform: scale(1.1);
}

/* Modern Notification Popup */
.updates-bell {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.bell-button {
    background: #ffffff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: #1d1d1f;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bell-button:hover {
    background-color: #f5f5f7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
}

.bell-button:active {
    background-color: #e5e5e7;
    transform: translateY(0) scale(0.95);
    -webkit-transform: translateY(0) scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff3b30, #ff6b6b);
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
    animation: notificationPulse 2s infinite;
    -webkit-animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@-webkit-keyframes notificationPulse {
    0%, 100% { -webkit-transform: scale(1); }
    50% { -webkit-transform: scale(1.1); }
}

.updates-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 360px;
    background: #ffffff;
    border-radius: 16px;
    color: #1d1d1f;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    -webkit-transform: translateY(-12px) scale(0.95);
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.updates-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    -webkit-transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

.close-dropdown {
    background: none;
    border: none;
    color: #86868b;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-dropdown:hover {
    background-color: #f5f5f7;
    color: #1d1d1f;
}

.close-dropdown:active {
    background-color: #e5e5e7;
    transform: scale(0.9);
}

.dropdown-content {
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.dropdown-content::-webkit-scrollbar {
    width: 4px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #e5e5e7;
    border-radius: 2px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #d1d1d6;
}

.update-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    transition: all 0.2s ease;
    -webkit-transition: all 0.2s ease;
    cursor: pointer;
}

.update-item:hover {
    background-color: #f8f9fa;
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.update-item:last-child {
    margin-bottom: 0;
}

.update-icon {
    font-size: 11px;
    margin-right: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    color: #0066cc;
    font-weight: 700;
    background: rgba(0, 102, 204, 0.1);
    padding: 6px 8px;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
}

.update-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #1d1d1f;
    font-weight: 500;
}

.update-item.new {
    background: linear-gradient(135deg, #f0f8ff, #ffffff);
    border-color: rgba(0, 102, 204, 0.2);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.update-item.new::before {
    content: 'NEW';
    position: absolute;
    top: -8px;
    right: 12px;
    background: linear-gradient(135deg, #0066cc, #007aff);
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    font-size: 16px;
    background-color: #ffffff;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.search-bar input:focus {
    outline: none;
    border-color: #0066cc;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-bar input::placeholder {
    color: #86868b;
}

/* Country List */
.country-list {
    border: 1px solid #e5e5e7;
    border-radius: 16px;
    background-color: #ffffff;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1px;
    background-color: #e5e5e7;
    overflow: hidden;
}

.country-item {
    background-color: #ffffff;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    position: relative;
}

.country-item:hover {
    background-color: #f5f5f7;
    transform: scale(1.02);
}

.country-item:active {
    background-color: #e5e5e7;
    transform: scale(0.98);
}

.country-code {
    font-size: 28px;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.country-name {
    font-size: 9px;
    color: #86868b;
    font-weight: 400;
    margin-bottom: 4px;
    text-align: center;
    line-height: 1.1;
}

.country-meta {
    font-size: 13px;
    color: #86868b;
    font-weight: 500;
}

/* Country Viewer */
.country-viewer {
    border: 1px solid #e5e5e7;
    border-radius: 16px;
    background-color: #ffffff;
    overflow: hidden;
}

.viewer-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e7;
    background-color: #f5f5f7;
}

.back-btn {
    background: none;
    border: none;
    color: #0066cc;
    cursor: pointer;
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-right: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: rgba(0, 102, 204, 0.1);
}

.back-btn:active {
    background-color: rgba(0, 102, 204, 0.2);
}

.viewer-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
}

.viewer-content {
    padding: 24px;
}

/* Data, Stats, and Visualization Sections */
.visualization-section,
.data-section,
.stats-section {
    margin-bottom: 32px;
}

.visualization-section h3,
.data-section h3,
.stats-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1d1d1f;
    border-bottom: 1px solid #e5e5e7;
    padding-bottom: 12px;
}

.csv-container,
.stats-container {
    background-color: #f5f5f7;
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    border: 1px solid #e5e5e7;
}

/* CSV Table Styles */
.csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e7;
}

.csv-table th,
.csv-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f5f5f7;
}

.csv-table th {
    background-color: #f5f5f7;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csv-table tr:hover {
    background-color: #f5f5f7;
}

.csv-table tr:last-child td {
    border-bottom: none;
}

/* Stats Content */
.stats-content {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #1d1d1f;
    background-color: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e5e7;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 16px 0;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e5e7;
}



/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #86868b;
    font-size: 16px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #86868b;
}

.empty-state h3 {
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d1d1f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    header {
        padding: 20px 0 16px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    .updates-bell {
        top: 16px;
        right: 16px;
    }
    
    .bell-button {
        width: 40px;
        height: 40px;
    }
    
    .bell-button svg {
        width: 18px;
        height: 18px;
    }
    
    .updates-dropdown {
        width: 300px;
        right: -10px;
    }
    
    .dropdown-header {
        padding: 16px 20px;
    }
    
    .dropdown-header h3 {
        font-size: 16px;
    }
    
    .dropdown-content {
        padding: 6px;
        max-height: 280px;
    }
    
    .update-item {
        padding: 12px;
        margin-bottom: 6px;
    }
    
    .update-icon {
        font-size: 10px;
        padding: 4px 6px;
        min-width: 28px;
    }
    
    .update-text {
        font-size: 13px;
    }
    
    .country-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .country-item {
        padding: 16px 12px;
        min-height: 80px;
    }
    
    .country-code {
        font-size: 24px;
    }
    
    .country-name {
        font-size: 8px;
    }
    
    .viewer-content {
        padding: 16px;
    }
    
    .csv-table {
        font-size: 13px;
    }
    
    .csv-table th,
    .csv-table td {
        padding: 10px 12px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Smooth transitions */
.country-item,
.back-btn {
    transition: all 0.2s ease;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}
