/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: #0a0e1a;
    min-height: 100vh;
    font-size: 14px; /* 기본 폰트 크기 설정 */
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Header */
.header {
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
    min-width: 200px;
}

.search-box {
    width: 100%;
    padding: 12px 20px 12px 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-box:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.hero p {
    font-size: 1rem;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
}

.login-prompt {
    margin-top: 2rem;
}

.login-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Categories */
.categories-section {
    margin-bottom: 3rem;
}

.category-section {
    margin-bottom: 2.5rem;
}

.category-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    opacity: 0.9;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2rem 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto 1rem auto;
    box-sizing: border-box;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-item:hover {
    transform: translateY(-3px);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.tool-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.tool-icon i {
    font-size: 24px;
    color: #333;
}

.tool-name {
    font-size: 0.8rem;
    color: #ffffff;
    text-align: center;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.2;
}

.add-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.add-tool:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.add-tool .tool-icon {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.add-tool .tool-icon i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
}

.add-tool .tool-name {
    color: rgba(255, 255, 255, 0.6);
}

/* Hide old tools section */
.tools-section {
    display: none;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.tool-card.featured {
    border: 2px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.tool-card.featured::before {
    content: "★";
    position: absolute;
    top: 10px;
    right: 15px;
    color: #ffd700;
    font-size: 1.2rem;
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 1rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #667eea;
}

.tool-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.tool-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-category {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.tool-stats {
    font-size: 0.8rem;
    color: #999;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }
    
    .category-grid {
        max-width: 100%;
        gap: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .search-container {
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem 1rem;
        max-width: 100%;
    }
    
    .tool-icon {
        width: 50px;
        height: 50px;
    }
    
    .tool-icon img {
        width: 28px;
        height: 28px;
    }
    
    .tool-icon i {
        font-size: 20px;
    }
    
    .tool-name {
        font-size: 0.75rem;
    }
    
    .login-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.85rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem 0.8rem;
    }
    
    .tool-icon {
        width: 45px;
        height: 45px;
    }
    
    .tool-icon img {
        width: 25px;
        height: 25px;
    }
    
    .tool-icon i {
        font-size: 18px;
    }
    
    .tool-name {
        font-size: 0.7rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 0.5rem;
    }
    
    .tool-icon {
        width: 40px;
        height: 40px;
    }
    
    .tool-name {
        font-size: 0.65rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-info {
    margin-bottom: 1.5rem;
    color: #666;
    text-align: center;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.footer a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

/* Login Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #1a1f2e;
    margin: 15% auto;
    padding: 1.6rem; /* 2rem * 0.8 = 1.6rem */
    border-radius: 12px; /* 15px * 0.8 = 12px */
    width: 90%;
    max-width: 320px; /* 400px * 0.8 = 320px */
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); /* 10px*0.8, 30px*0.8 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: rgba(255, 255, 255, 0.6);
    float: right;
    font-size: 22.4px; /* 28px * 0.8 = 22.4px */
    font-weight: bold;
    position: absolute;
    right: 12px; /* 15px * 0.8 = 12px */
    top: 8px; /* 10px * 0.8 = 8px */
    cursor: pointer;
}

.close:hover {
    color: white;
}

.modal h2 {
    color: white;
    margin-bottom: 1.2rem; /* 1.5rem * 0.8 = 1.2rem */
    text-align: center;
    font-size: 1.2rem; /* 1.5rem * 0.8 = 1.2rem */
}

.modal .form-group {
    margin-bottom: 0.8rem; /* 1rem * 0.8 = 0.8rem */
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.4rem; /* 0.5rem * 0.8 = 0.4rem */
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.72rem; /* 0.9rem * 0.8 = 0.72rem */
}

.modal .form-group input {
    width: 100%;
    padding: 0.6rem; /* 0.75rem * 0.8 = 0.6rem */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6.4px; /* 8px * 0.8 = 6.4px */
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.8rem; /* 1rem * 0.8 = 0.8rem */
}

.modal .form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.modal .btn {
    width: 100%;
    padding: 0.6rem; /* 0.75rem * 0.8 = 0.6rem */
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6.4px; /* 8px * 0.8 = 6.4px */
    font-size: 0.8rem; /* 1rem * 0.8 = 0.8rem */
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal .btn:hover {
    background: #5a6fd8;
}
