/* ===========================================
   Base Styles (Reset, Typography, Layout)
   =========================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Main Container */
.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 16px;
    width: 100%;
    flex: 1;
}

/* Search Bar */
.search-section {
    margin-bottom: 16px;
}

.search-wrapper {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0;
}

.search-input {
    flex: 1;
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary-green);
}

.search-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #34d058 0%, #28a745 50%, #22863a 100%);
    color: white;
    border: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.search-btn:hover {
    background: linear-gradient(135deg, #3cdf63 0%, #2ebd4f 50%, #28a745 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.search-btn:active {
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1rem;
    color: var(--primary-green);
    font-weight: 500;
}

/* Popup */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.popup-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 320px;
    width: 90%;
    text-align: center;
    display: none;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* Modal Styles */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

/* No Match Message */
.no-match-message {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    .search-wrapper {
        flex-direction: row;
        gap: 0;
        max-width: 100%;
    }

    .search-input {
        padding: 10px 14px;
        font-size: 0.9rem;
        min-width: 0;
    }

    .search-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}
