/* 기본 스타일 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* 사용자 정보 드롭다운 스타일 */
.dropdown-item-text {
    white-space: nowrap;
    max-width: 250px;
    padding: 0.5rem 1rem;
    color: #6c757d;
}

.dropdown-item-text strong {
    color: #495057;
}

.dropdown-header {
    font-weight: 600;
    color: #495057;
}

/* 네비게이션 사용자 정보 스타일 */
.nav-link.dropdown-toggle {
    display: flex !important;
    align-items: center;
}

.nav-link.dropdown-toggle span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 컴팩트 메뉴 스타일 */
.compact-menu {
    min-width: 650px;
    max-width: 750px;
}

.compact-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-item i {
    font-size: 0.8rem;
    width: 16px;
    display: inline-block;
}

.dropdown-header {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
}

/* 반응형 네비게이션 개선 */
@media (max-width: 767.98px) {
    .navbar-brand span {
        font-size: 0.9rem;
    }

    .nav-link {
        padding: 0.5rem 1rem;
    }

    .dropdown-menu {
        width: 100%;
        border: none;
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.95);
    }

    .compact-menu {
        min-width: 100%;
        max-width: 100%;
    }

    .compact-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.75rem;
    }

    .navbar-collapse {
        margin-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .nav-link span {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* 테마 토글 버튼 모바일 최적화 */
@media (max-width: 767.98px) {
    #themeToggle {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
}

/* Bootstrap 호환 스타일 */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.navbar-brand {
    font-weight: bold;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.alert {
    border: none;
    border-radius: 8px;
}

/* Main styles */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Tool cards */
.tool-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.tool-icon {
    margin-bottom: 1rem;
}

.tool-item {
    transition: transform 0.2s ease;
}

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

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 15px;
    margin-bottom: 3rem;
}

/* Category sections */
.category-section {
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
}

.category-section:last-child {
    border-bottom: none;
}

/* Social links */
.social-links a {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #007bff !important;
}

/* Navigation styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 600;
}

.nav-link {
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #f8f9fa !important;
}

/* Sticky dropdown styles */
.dropdown.sticky-mode .dropdown-menu {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    z-index: 9999 !important;
    transform: none !important;
    border-radius: 0 !important;
    border-top: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
    background-color: #fff !important;
    margin: 0 !important;
}

.dropdown.sticky-mode .dropdown-menu.show {
    display: block !important;
}

.dropdown.sticky-mode .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
}

.dropdown.sticky-mode .dropdown-toggle::after {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Sticky mode indicator */
.dropdown.sticky-mode .dropdown-toggle::before {
    content: "📌 ";
    font-size: 0.8em;
    margin-right: 4px;
}

/* Body padding when sticky menu is active */
body.sticky-tools-active {
    padding-top: 0;
}

body.sticky-tools-active main {
    margin-top: 320px; /* Adjust based on dropdown height */
}

/* Close button for sticky mode */
.sticky-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sticky-close-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Animation for sticky mode */
.dropdown-menu.sticky-enter {
    animation: stickyEnter 0.3s ease-out;
}

.dropdown-menu.sticky-exit {
    animation: stickyExit 0.3s ease-in;
}

@keyframes stickyEnter {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes stickyExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Responsive sticky dropdown */
@media (max-width: 768px) {
    .dropdown.sticky-mode .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }

    body.sticky-tools-active main {
        margin-top: 250px;
    }

    .sticky-close-btn {
        top: 5px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    body.sticky-tools-active main {
        margin-top: 200px;
    }

    .dropdown.sticky-mode .dropdown-menu .container-fluid {
        padding: 10px;
    }

    .dropdown.sticky-mode .dropdown-menu .col-md-3 {
        margin-bottom: 15px;
    }
}