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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5dc;
    overflow: hidden;
}

header {
    background: #f5f5dc;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
}

.logo {
    font-size: 48px;
    font-weight: 900;
    color: #4169e1;
    letter-spacing: -2px;
}

nav {
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(65, 105, 225, 0.1);
    color: #4169e1;
}

.nav-btn.active {
    color: #4169e1;
}

.nav-btn svg {
    width: 40px;
    height: 40px;
}

main {
    display: flex;
    height: calc(100vh - 120px);
    position: relative;
}

#globe-container {
    flex: 1;
    position: relative;
    cursor: grab;
}

#globe-container:active {
    cursor: grabbing;
}

#sidebar {
    width: 450px;
    background: #f5f5dc;
    padding: 30px;
    overflow-y: auto;
    border-left: 2px solid #333;
}

#region-info {
    margin-bottom: 30px;
}

#region-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

#region-subtitle {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

#deck-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.deck-card {
    background: #d3d3d3;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    border-left: 5px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.deck-card:hover {
    transform: translateX(-5px);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
}

.deck-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
    box-shadow: 0 0 10px currentColor;
}

.deck-content {
    flex: 1;
}

.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.deck-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.deck-location {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.deck-region {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-bottom: 8px;
}

.deck-subtitle {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    font-weight: 500;
}

.deck-examples {
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.6;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 10px;
    margin-top: 10px;
}

/* Deck Detail Panel */
.deck-detail-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 450px;
    height: 450px;
    background: linear-gradient(180deg, rgba(65, 105, 225, 0) 0%, rgba(65, 105, 225, 0.85) 50%, rgba(25, 70, 180, 0.95) 100%);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 60px 40px;
}

.deck-detail-panel.visible {
    transform: translateY(0);
}

.deck-detail-panel.hidden {
    transform: translateY(100%);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    font-size: 36px;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
    font-weight: 300;
    pointer-events: auto;
}

.close-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.deck-detail-content {
    max-width: 1400px;
    margin: 0 auto;
}

.deck-detail-header {
    margin-bottom: 30px;
    color: white;
}

.deck-detail-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
}

.deck-detail-subtitle {
    font-size: 18px;
    opacity: 0.9;
}

.flashcards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.flashcard {
    background: white;
    border-radius: 30px;
    padding: 16px 24px;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: fit-content;
    max-width: 400px;
}

.flashcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.flashcard-word {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    white-space: nowrap;
}

.flashcard-emoji {
    font-size: 36px;
    flex-shrink: 0;
}

/* Scrollbar styling */
#sidebar::-webkit-scrollbar {
    width: 8px;
}

.deck-detail-panel::-webkit-scrollbar {
    width: 10px;
}

.deck-detail-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.deck-detail-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.deck-detail-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 1024px) {
    #sidebar {
        width: 350px;
        padding: 20px;
    }

    .deck-detail-panel {
        right: 350px;
    }

    .logo {
        font-size: 36px;
    }

    #region-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    #globe-container {
        height: 50vh;
    }

    #sidebar {
        width: 100%;
        height: 50vh;
        border-left: none;
        border-top: 2px solid #333;
    }

    .deck-detail-panel {
        right: 0;
        left: 0;
    }

    header {
        padding: 15px 20px;
    }

    .logo {
        font-size: 28px;
    }

    .nav-btn span {
        font-size: 12px;
    }

    .nav-btn svg {
        width: 30px;
        height: 30px;
    }
}