/* Import modern fonts: Inter (Latin) and Noto Sans JP (Japanese) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --primary-color: #4f46e5; /* Modern Indigo */
    --primary-hover: #4338ca;
    --bg-light: #f9fafb;
    --text-dark: #111827;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Navbar Tweaks */
.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.nav-link {
    font-weight: 500;
    color: #4b5563 !important;
    padding-left: 1rem !important; /* Breathable spacing for JP text */
    padding-right: 1rem !important;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Modern Search Input */
.hero-search-input {
    border: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 50px 0 0 50px !important; /* Rounded pill left */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.hero-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.hero-search-btn {
    background-color: var(--primary-color);
    border: none;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 0 50px 50px 0 !important; /* Rounded pill right */
    font-weight: 600;
    transition: background-color 0.2s;
}

.hero-search-btn:hover {
    background-color: var(--primary-hover);
}

/* Card styling for content */
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 2rem;
}

/* Table Tweaks */
.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    background-color: #f9fafb; /* Light gray header */
    border-bottom: 1px solid #e5e7eb;
}

/* Monospace font for barcodes */
.font-monospace {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Limit text to 2 lines for descriptions */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

/* Pagination overrides for Pill look */
.page-link {
    color: var(--text-dark);
    border-color: #e5e7eb;
    font-size: 0.9rem;
}

.page-link:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* AI Insights Card Styling */
.bg-gradient-primary {
    background: linear-gradient(45deg, var(--primary-color), #818cf8);
    color: white;
}

/* Ensure the progress bars in the sidebar look pill-shaped */
.progress {
    background-color: #f3f4f6; /* Lighter gray background */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

/* Refined Table Styling for details */
.table th {
    font-weight: 500;
    font-size: 0.9rem;
    background-color: #f9fafb;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
}

/* Country Card Animation */
.country-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-color: var(--primary-color) !important;
}

.country-card .display-4 {
    /* Ensures emojis look consistent across browsers */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Blog Specific Styling */

/* Make cards lift slightly on hover for the list view */
.transition-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.transition-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

/* Typography for the Single Post Content */
.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151; /* Soft dark gray */
}

.blog-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #111827;
}

.blog-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    font-style: italic;
    color: #4b5563;
    margin: 2rem 0;
}

/* API Documentation Styles */

/* Sidebar Navigation */
#api-sidebar .nav-link {
    color: #4b5563;
    padding: 0.5rem 1rem;
    border-left: 2px solid transparent;
    border-radius: 0;
}

#api-sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: #f9fafb;
}

#api-sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Code Blocks (Static) */
.code-block {
    background-color: #1e1e1e; /* VS Code Dark */
    border-radius: 6px;
    padding: 1rem;
    color: #d4d4d4;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

/* Response Blocks (Interactive) */
.response-block {
    background-color: #2d2d2d;
    color: #a6e22e; /* Monokai Green */
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #444;
}

/* Playground Area */
.playground {
    border: 1px solid #e5e7eb;
}

/* Accordion Modernization */
.accordion-item {
    border: 1px solid #e5e7eb;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: #eff6ff; /* Very light blue */
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0,0,0,.125);
}

/* Card Hover Effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-color: var(--primary-color) !important;
    z-index: 10;
}

/* Ensure icons scale smoothly */
.card-hover i {
    transition: transform 0.2s;
}

.card-hover:hover i {
    transform: scale(1.1);
}

/* Button Animation */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Error Shake Animation */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake-animation {
    animation: shake 0.3s ease-in-out;
}

/* Dashboard Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Footer Link Hover Effect */
.link-hover:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

/* Ensure footer sticks to bottom if page content is short */
/* (This assumes you have 'd-flex flex-column min-vh-100' on your <body> tag as we did in previous steps) */
footer {
    width: 100%;
}
