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

body 
{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header 
{
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 
{
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p 
{
    font-size: 1.1em;
    opacity: 0.9;
}

.search-box 
{
    margin-top: 20px;
}

.search-box input 
{
    padding: 12px 20px;
    width: 300px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box button 
{
    padding: 12px 25px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: transform 0.2s, background 0.2s;
}

.search-box button:hover 
{
    transform: scale(1.05);
    background: #ff5252;
}

.main-content 
{
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
}

.map-container 
{
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

#map 
{
    width: 100%;
    height: 600px;
    border-radius: 10px;
}

.info-panel 
{
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-height: 600px;
    overflow-y: auto;
}

.info-header 
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.info-header h2 
{
    color: #333;
}

.placeholder 
{
    color: #999;
    text-align: center;
    padding: 40px 20px;
}

.country-detail 
{
    animation: fadeIn 0.3s ease-in;
}

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

.country-detail h3 
{
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.country-detail .official-name 
{
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-grid 
{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.info-item 
{
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s;
}

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

.info-item label 
{
    font-weight: bold;
    color: #667eea;
    display: block;
    font-size: 0.85em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value 
{
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
}

.description 
{
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    color: #555;
}

.loading 
{
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.loading::after 
{
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots 
{
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

.error 
{
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background: #ffeaea;
    border-radius: 8px;
}

.search-results 
{
    padding: 10px;
}

.search-results h3 
{
    color: #667eea;
    margin-bottom: 15px;
}

.search-results ul 
{
    list-style: none;
}

.search-results li 
{
    padding: 12px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-results li:hover 
{
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

/* Responsive design */
@media (max-width: 968px) 
{
    .main-content 
    {
        grid-template-columns: 1fr;
    }
    
    .info-panel 
    {
        max-height: 400px;
    }
}

@media (max-width: 600px) 
{
    .search-box input 
    {
        width: 200px;
    }
    
    .info-grid 
    {
        grid-template-columns: 1fr;
    }
    
    header h1 
    {
        font-size: 1.8em;
    }
}

/* Modal Background */
.modal 
{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow: hidden; /* Prevent background scrolling */
}

.modal.show 
{
    display: block;
}

/* Modal Dialog Container */
.modal-dialog 
{
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fixed Header with Close Button */
.modal-header 
{
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    backdrop-filter: blur(10px);
}

/* Close Button */
.close-btn
{
    background: #ff4757;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.close-btn:hover 
{
    background: #ff6b81;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
}

/* Scrollable Content Area */
.modal-body 
{
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

/* Style the scrollbar for webkit browsers */
.modal-body::-webkit-scrollbar 
{
    width: 8px;
}

.modal-body::-webkit-scrollbar-track 
{
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb 
{
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover 
{
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) 
{
    .modal-dialog 
    {
        width: 95%;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .modal-close 
    {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

/* ============================================ */
/* AUTH MODAL STYLES */
/* ============================================ */

/* Auth Modal Dialog - Smaller and Centered */
.auth-dialog 
{
    max-width: 420px;
    height: auto;
    max-height: 90vh;
    margin: 10vh auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn 
{
    from 
    {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to 
    {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Auth Modal Header */
#authModal .modal-header 
{
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px 20px;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: none;
}

#authTitle 
{
    color: white;
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Close button override for auth modal */
#authModal .modal-close 
{
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    width: 32px;
    height: 32px;
    font-size: 18px;
    box-shadow: none;
}

#authModal .modal-close:hover 
{
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Auth Modal Body */
#authModal .modal-body 
{
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: white;
}

/* Auth Forms */
.auth-form 
{
    animation: fadeIn 0.3s ease;
}

.auth-form .form-group 
{
    margin-bottom: 20px;
}

.auth-form label 
{
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form input 
{
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    outline: none;
    box-sizing: border-box;
}

.auth-form input:focus 
{
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.auth-form input::placeholder 
{
    color: #aaa;
}

/* Auth Button */
.auth-btn 
{
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.auth-btn:hover 
{
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.auth-btn:active 
{
    transform: translateY(0);
}

/* Auth Switch Link */
.auth-switch 
{
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 0.9em;
}

.auth-switch a 
{
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-switch a:hover 
{
    color: #764ba2;
    text-decoration: underline;
}

/* Auth Message */
#authMessage 
{
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

/* Auth Button in Header */
.auth-button 
{
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.auth-button:hover 
{
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Responsive Auth Modal */
@media (max-width: 480px) 
{
    .auth-dialog 
    {
        width: 92%;
        max-width: none;
        margin: 5vh auto;
        border-radius: 12px;
    }
    #authModal .modal-header 
    {
        padding: 20px;
    }
    #authTitle 
    {
        font-size: 1.3em;
    }
    #authModal .modal-body 
    {
        padding: 20px;
    }
}

/*******************************************************/
/* Header Layout */
.header-top 
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-brand {
    text-align: left;
}

.header-brand h1 
{
    font-size: 2.2em;
    margin-bottom: 2px;
}

.tagline 
{
    font-size: 1em;
    opacity: 0.8;
    font-style: italic;
}

.header-actions 
{
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* Benefits text */
.auth-benefits 
{
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
    margin: 0;
    padding-right: 18px;
    /*white-space: nowrap;*/
}

/* Auth Button */
.auth-button 
{
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.auth-button:hover 
{
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Search stays centered */
.search-box 
{
    text-align: center;
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) 
{
    .header-top 
    {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .header-brand 
    {
        text-align: center;
    }
    .header-actions 
    {
        align-items: center;
    }
}

/* Status Buttons */
.status-btn 
{
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.status-btn:hover 
{
    border-color: #667eea;
    background: #f0f2ff;
}

.status-active-visited 
{
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    font-weight: 600;
}

.status-active-want 
{
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
    font-weight: 600;
}

/* Stats Modal */
#statsModal .modal-header 
{
    justify-content: space-between;
    padding: 20px 25px;
}

#statsModal .modal-header h2 
{
    color: #333;
    font-size: 1.3em;
}

/* Stats Summary Boxes */
.stats-summary 
{
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.stats-box 
{
    flex: 1;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    max-width: 150px;
}

.visited-box 
{
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.wish-box 
{
    background: linear-gradient(135deg, #ff9800, #e65100);
}

.total-box 
{
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stats-number 
{
    display: block;
    font-size: 2em;
    font-weight: 700;
}

.stats-label 
{
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
    margin-top: 5px;
}

/* Stats Country Grid */
.stats-grid 
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.stats-country-card 
{
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.stats-country-card:hover 
{
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stats-country-name 
{
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
}

/* Header Share Icons */
.header-share 
{
    display: flex;
    gap: 8px;
    align-items: left;
}

.share-icon 
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    text-decoration: none;
}

.share-icon:hover 
{
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}