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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    padding: 0;
    color: #ffffff;
}

/* 메인 네비게이션 */
.main-nav {
    background: #2d2d2d;
    border-bottom: 2px solid #1a1a1a;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-logo a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: 700;
    transition: color 0.3s;
}

.nav-logo a:hover {
    color: #e0e0e0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.3s;
    display: block;
    position: relative;
    background: none;
    border: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #00ff00;
}

.nav-link.active::after {
    width: 100%;
    background: #00ff00;
}

/* 네비게이션 드롭다운 (텔레그램 게임) */
.nav-dropdown {
    position: relative;
}
.nav-dropdown > .nav-link {
    cursor: pointer;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d2d2d;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-radius: 4px;
    z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
}
.nav-dropdown-menu li a:hover {
    background: #3d3d3d;
}

/* 햄버거 메뉴 버튼 */
.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2d2d2d;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    }
    
    .nav-menu.active {
        max-height: 300px;
        padding: 10px 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid #1a1a1a;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link.active {
        border-bottom: 1px solid #1a1a1a;
        border-left: 4px solid #ffffff;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .container {
        margin-top: 0;
        border-radius: 0;
        padding: 20px;
    }
}

.container {
    max-width: 1200px;
    margin: 8px auto;
    background: #4a4a4a;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 15px;
    color: #ffffff;
}

header {
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #666666;
}

header h1 {
    font-size: 1.6em;
    color: #ffffff;
    margin-bottom: 3px;
}

header p {
    color: #e0e0e0;
    font-size: 0.9em;
}

.recent-chats {
    margin-bottom: 15px;
    background: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.recent-header:hover {
    background: #3a3a3a;
}

.recent-label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9em;
    margin: 0;
}

.accordion-icon {
    font-size: 0.8em;
    color: #ffffff;
    transition: transform 0.2s;
}

.recent-content {
    padding: 12px 20px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.recent-chat-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.recent-chat-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #000000;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    line-height: 1.4;
    vertical-align: middle;
}

.recent-chat-label:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.recent-chat-label:active {
    transform: translateY(0);
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 30px;
    padding: 25px;
    background: #2d2d2d;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.filter-group:first-child {
    min-width: 200px;
    max-width: 300px;
}

/* 커스텀 드롭다운 */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 2px solid #c5c5c5;
    border-radius: 6px;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 42px;
    color: #1a1a1a;
}

.dropdown-selected:hover {
    border-color: #adadad;
    background: #d5d5d5;
}

.dropdown-selected:focus {
    outline: none;
    border-color: #adadad;
    box-shadow: 0 0 0 3px rgba(173, 173, 173, 0.2);
}

.selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1a1a;
}

.dropdown-arrow {
    margin-left: 10px;
    color: #1a1a1a;
    font-size: 0.8em;
    transition: transform 0.3s;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: #e0e0e0;
    border: 2px solid #c5c5c5;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-search {
    padding: 10px;
    border-bottom: 1px solid #c5c5c5;
}

.dropdown-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c5c5c5;
    border-radius: 4px;
    font-size: 0.95em;
    background: #f5f5f5;
    color: #1a1a1a;
}

.dropdown-search input:focus {
    outline: none;
    border-color: #adadad;
    box-shadow: 0 0 0 2px rgba(173, 173, 173, 0.2);
}

.dropdown-options {
    overflow-y: auto;
    max-height: 300px;
}

.dropdown-option {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    border-bottom: 1px solid #d5d5d5;
    color: #1a1a1a;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: #d5d5d5;
}

.dropdown-option.selected {
    background: #c5c5c5;
    color: #1a1a1a;
}

.option-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1a1a;
}

.option-username {
    margin-left: 10px;
    color: #666666;
    font-size: 0.9em;
    white-space: nowrap;
    font-weight: 500;
}

.option-id {
    margin-left: 10px;
    color: #666666;
    font-size: 0.9em;
    white-space: nowrap;
}

.dropdown-option.no-results {
    padding: 20px;
    text-align: center;
    color: #666666;
    cursor: default;
}

.dropdown-option.no-results:hover {
    background: #e0e0e0;
}

.datetime-group {
    min-width: 280px;
}

.datetime-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.datetime-inputs input[type="date"] {
    flex: 1;
    min-width: 140px;
}

.time-select {
    flex: 0 0 auto;
    min-width: 70px;
}

.filter-section > .btn {
    flex: 0 0 auto;
    align-self: flex-end;
    white-space: nowrap;
}

/* 프로젝트 선택 섹션 */
.project-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #2d2d2d;
    border-radius: 8px;
}

.project-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 0.95em;
}

.project-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 15px;
    border: 2px solid #000000;
    border-radius: 6px;
    background: #1a1a1a;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #000000;
    background: #2d2d2d;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #00ff00;
}

.radio-option input[type="radio"]:checked + span {
    color: #ffffff;
    font-weight: 600;
}

.radio-option input[type="radio"]:checked ~ span,
.radio-option:has(input[type="radio"]:checked) {
    border-color: #00ff00;
    background: #000000;
}

.radio-option span {
    color: #ffffff;
    font-size: 0.95em;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 0.9em;
}

.form-control {
    padding: 10px 15px;
    border: 2px solid #c5c5c5;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s;
    background: #e0e0e0;
    color: #1a1a1a;
}

.form-control:focus {
    outline: none;
    border-color: #adadad;
    box-shadow: 0 0 0 3px rgba(173, 173, 173, 0.2);
}

.form-control:disabled {
    background-color: #999999;
    cursor: not-allowed;
    opacity: 0.7;
    color: #666666;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    align-self: end;
}

.btn-primary {
    background: linear-gradient(304deg, #adadad 0%, #4d4d4d 100%);
    color: white;
    border: 1px solid #c5c5c5;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(77, 77, 77, 0.4);
}

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

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a1a1a;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 5px;
}

.results h2 {
    color: #ffffff;
    margin-bottom: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.btn-copy {
    background: #333333;
    color: #ffffff;
    border: 1px solid #555555;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #444444;
    border-color: #00ff00;
    color: #00ff00;
}

.results-meta {
    color: #e0e0e0;
    font-size: 0.9em;
    margin-bottom: 20px;
    line-height: 1.5;
}

.table-wrapper {
    position: relative;
    width: 100%;
}

.table-scroll-top {
    width: 100%;
    margin-bottom: 5px;
}

.table-scroll-bottom {
    width: 100%;
    margin-top: 5px;
}

.table-container {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* 기본 스크롤바 숨김 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 웹킷 브라우저용 스크롤바 숨김 */
.table-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.table-scroll-top,
.table-scroll-bottom {
    height: 10px;
    margin: 3px 0;
    overflow: visible;
    position: relative;
    display: none;
    visibility: hidden;
}

.scrollbar-track {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.scrollbar-thumb {
    height: 6px;
    background: linear-gradient(307deg, #00e300 0%, #009f00 100%);
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
    cursor: grab;
    transition: background 0.2s;
    min-width: 20px;
}

.scrollbar-thumb:hover {
    background: linear-gradient(307deg, #019b01 0%, #1e921e 100%);
}

.scrollbar-thumb:active {
    cursor: grabbing;
}

.rank-table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    background: #1a1a1a;
}

.rank-table thead {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: white;
}

.rank-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    position: relative;
    padding-right: 25px;
}

.rank-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.rank-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.rank-table th.sortable:hover::after {
    opacity: 1;
}

.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.85em;
    font-weight: bold;
    opacity: 1;
}

/* 툴팁 아이콘 */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #666666;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.7em;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
    margin-right: 2px;
    position: relative;
    vertical-align: middle;
}

.tooltip-icon:hover {
    background: #00ff00;
    color: #000000;
}

/* 툴팁 박스 (JavaScript로 생성) */
.tooltip-box {
    position: fixed;
    background: #1a1a1a;
    color: #ffffff;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: normal;
    white-space: normal;
    width: 280px;
    max-width: calc(100vw - 40px);
    line-height: 1.5;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a3a;
    text-transform: none;
    letter-spacing: normal;
    pointer-events: none;
}

.tooltip-box::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 10px;
    border: 6px solid transparent;
    border-bottom-color: #1a1a1a;
}

@media (max-width: 768px) {
    .tooltip-box {
        width: 240px;
        max-width: calc(100vw - 30px);
        font-size: 11px;
        padding: 10px 12px;
    }
}

.rank-table td {
    padding: 5px;
    border-bottom: 1px solid #2d2d2d;
    color: #ffffff;
}

.rank-table tbody tr:hover {
    background: #2d2d2d;
}

.rank-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-cell {
    font-weight: 700;
    color: #ffffff;
    width: 80px;
    text-align: center;
}

.name-cell {
    font-weight: 500;
    color: #ffffff;
}

.username-cell {
    color: #e0e0e0;
    font-size: 0.9em;
}

.count-cell {
    font-weight: 600;
    color: #ffffff;
    text-align: right;
}

.avg-length-cell {
    font-weight: 500;
    color: #e0e0e0;
    text-align: right;
    font-size: 0.95em;
}

.activity-cell {
    text-align: center;
    font-size: 0.9em;
}

.activity-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85em;
    margin-right: 5px;
}

.activity-consistent {
    background: #e8f5e9;
    color: #2e7d32;
}

.activity-mixed {
    background: #fff3e0;
    color: #e65100;
}

.activity-burst {
    background: #fce4ec;
    color: #c2185b;
}

.activity-days {
    display: block;
    color: #cccccc;
    font-size: 0.8em;
    margin-top: 3px;
}

.no-data {
    text-align: center;
    color: #cccccc;
    padding: 40px !important;
    font-style: italic;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.btn-page {
    padding: 10px 20px;
    border: 2px solid #000000;
    border-radius: 6px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-page:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #2d2d2d;
    color: #666666;
}

.page-info {
    font-size: 1em;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 120px;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 0;
        border-radius: 0;
    }

    header h1 {
        font-size: 2em;
    }

    .filter-section {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .filter-group,
    .datetime-group {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
    
    .filter-group:first-child {
        max-width: 100%;
    }
    
    .filter-group label {
        margin-bottom: 5px;
    }
    
    .dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-options {
        max-height: 200px;
    }

    .btn {
        width: 100%;
    }

    .rank-table {
        font-size: 0.9em;
    }

    .rank-table th,
    .rank-table td {
        padding: 10px 8px;
    }


    .datetime-inputs {
        flex-direction: row;
        gap: 6px;
    }

    .datetime-inputs input[type="date"] {
        flex: 1;
        min-width: 0;
        font-size: 0.9em;
    }

    .time-select {
        flex: 0 0 auto;
        min-width: 60px;
        font-size: 0.9em;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
    }

    .btn-page {
        width: 100%;
    }

    .project-section {
        padding: 15px;
    }

    .project-radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-option {
        width: 100%;
    }
}

/* 도움말 페이지 스타일 */
.help-section {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #3a3a3a;
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding-bottom: 4px;
    border-bottom: 2px solid #4a4a4a;
    transition: all 0.3s;
}

.help-header:hover {
    border-bottom-color: #00ff00;
}

.help-section h2 {
    color: #ffffff;
    font-size: 1.15em;
    margin: 0;
    padding: 0;
    border: none;
}

.help-content {
    margin-top: 6px;
    transition: all 0.3s ease;
}

.accordion-icon {
    color: #00ff00;
    font-size: 1em;
    transition: transform 0.3s ease;
    user-select: none;
}

.command-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.command-group h3 {
    color: #ffffff;
    font-size: 1em;
    margin: 8px 0 6px 0;
    padding: 0;
    border: none;
    font-weight: 600;
}

.command-item {
    background: #1a1a1a;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #4a4a4a;
    transition: all 0.3s;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.command-item:hover {
    border-left-color: #00ff00;
    background: #222222;
}

.command-item code {
    display: inline-block;
    background: #2d2d2d;
    color: #00ff00;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.command-desc {
    color: #e0e0e0;
    font-size: 0.85em;
    flex: 1;
    min-width: 0;
}

.command-item p {
    color: #e0e0e0;
    margin: 5px 0;
    line-height: 1.5;
    font-size: 0.95em;
}

.command-item small {
    display: inline-block;
    color: #a0a0a0;
    font-size: 0.75em;
    line-height: 1.3;
    margin-left: auto;
}

.command-item small a {
    color: #00ff00;
    text-decoration: none;
}

.command-item small a:hover {
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
    vertical-align: middle;
    margin-right: 4px;
}

.badge-admin {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #ffffff;
    border: 1px solid #ff5252;
}

.badge-permission {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: #ffffff;
    border: 1px solid #26a69a;
}

.web-link {
    display: inline-block;
    background: linear-gradient(304deg, #adadad 0%, #4d4d4d 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    border: 1px solid #c5c5c5;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.web-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.info-box {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.info-box li {
    color: #e0e0e0;
    padding: 3px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
    font-size: 0.9em;
}

.info-box li:before {
    content: "•";
    color: #00ff00;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.info-box li a {
    color: #00ff00;
    text-decoration: none;
}

.info-box li a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin: 5px auto;
    }

    header {
        margin-bottom: 12px;
        padding-bottom: 6px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 0.85em;
    }

    .help-section {
        padding: 11px;
        margin-bottom: 11px;
    }

    .help-section h2 {
        font-size: 1.1em;
    }

    .help-content {
        margin-top: 6px;
    }

    .command-item {
        padding: 7px 11px;
        gap: 5px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .command-item code {
        font-size: 0.85em;
        padding: 2px 5px;
        flex-shrink: 0;
    }

    .command-desc {
        font-size: 0.85em;
        flex: 1;
        min-width: 0;
    }

    .command-item small {
        font-size: 0.75em;
        margin-left: 0;
        width: 100%;
        flex-basis: 100%;
    }

    .badge {
        font-size: 0.65em;
        padding: 1px 5px;
        flex-shrink: 0;
    }

    .command-group {
        gap: 6px;
    }

    .command-group h3 {
        font-size: 0.95em;
        margin: 6px 0 4px 0;
    }
}

/* 네비게이션 로그인 위젯 */
.nav-login {
    display: flex;
    align-items: center;
    gap: 10px;
}

#telegram-login-widget {
    display: flex;
    align-items: center;
    justify-content: center;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.user-profile:hover {
    transform: scale(1.1);
}

.user-profile:hover .logout-icon {
    opacity: 1;
    transform: scale(1);
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    display: block;
}

.logout-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 20px;
    opacity: 0;
    transition: all 0.2s;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile:hover .user-avatar-img {
    opacity: 0.7;
}

/* 로그아웃 팝업 */
.logout-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideDown 0.2s ease-out;
}

.logout-action {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    transition: background 0.2s;
    text-align: left;
}

.logout-action:hover {
    background: #3d3d3d;
}

.logout-emoji {
    font-size: 1.2em;
}

.logout-text {
    font-weight: 500;
}

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

.nav-login {
    position: relative;
}

/* 이벤트 페이지 스타일 */
.event-register-bar {
    display: flex;
    justify-content: center;
    margin: 8px 0 22px 0;
}

.event-register-btn {
    width: 50%;
    max-width: 560px;
}

.event-checkin-btn {
    margin-top: 8px;
    width: fit-content;
}

.event-manage-btn {
    width: fit-content;
    background: #444;
    color: #fff;
    border: 1px solid #5a5a5a;
    flex-shrink: 0;
}

.channel-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.channel-select-row #channelSelect {
    flex: 1;
    min-width: 520px;
}

.login-section {
    margin: 30px 0;
}

.login-box {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #3d3d3d;
}

.login-box h2 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.login-box p {
    color: #e0e0e0;
    margin-bottom: 30px;
    font-size: 1em;
}

#telegram-login-widget-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

.events-section {
    margin-top: 30px;
}

.events-header {
    margin-bottom: 20px;
}

.events-header h2 {
    color: #ffffff;
    font-size: 1.5em;
    margin: 0;
}

.events-list {
    display: grid;
    gap: 20px;
}

.event-card {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid #3d3d3d;
    transition: all 0.3s;
}

.event-card:hover {
    border-color: #4d4d4d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.event-header h3 {
    color: #ffffff;
    font-size: 1.2em;
    margin: 0;
    line-height: 1.3;
}

.event-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.event-status {
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.event-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.event-status.upcoming {
    background: #e3f2fd;
    color: #1976d2;
}

.event-status.ended {
    background: #fce4ec;
    color: #c2185b;
}

.event-body {
    color: #e0e0e0;
}

.event-description {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1em;
}

.event-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

.event-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    min-width: 0;
}

.event-detail-item strong {
    color: #bfc7d5;
    font-size: 0.86em;
    font-weight: 600;
}

.event-detail-item span {
    color: #ffffff;
    word-break: break-word;
}

.event-edit-btn {
    margin: 0;
    font-size: 0.78em;
    padding: 4px 8px;
    line-height: 1.2;
}

.no-events {
    text-align: center;
    padding: 60px 20px;
    color: #e0e0e0;
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #3d3d3d;
}

.no-events p {
    font-size: 1.1em;
    margin: 0;
}

.event-register-card {
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #3d3d3d;
    padding: 24px;
}

.event-input {
    width: 100%;
    margin-top: 8px;
}

.missions-wrap {
    margin-top: 8px;
    display: grid;
    gap: 10px;
}

.mission-row {
    display: flex;
    gap: 8px;
}

.mission-input {
    flex: 1;
}

.mission-type {
    width: 180px;
    min-width: 180px;
}

.mission-add-btn {
    margin-top: 10px;
}

.mission-remove-btn {
    background: #444;
    color: #fff;
    border: 1px solid #5a5a5a;
}

.event-register-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}

.event-register-result {
    margin-top: 16px;
    background: #1f1f1f;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    padding: 12px;
}

.event-detail-container {
    margin-top: 20px;
}

.event-detail-card {
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #3d3d3d;
    padding: 24px;
}

.event-subtitle {
    color: #c7c7c7;
    margin-top: 4px;
}

.event-detail-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0 14px;
}

.event-detail-btn-sm {
    padding: 8px 14px;
    font-size: 0.9em;
    line-height: 1.2;
    align-self: auto;
}

.event-detail-list-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #3f3f3f;
    color: #fff;
    border: 1px solid #5a5a5a;
}

.event-detail-list-btn:hover {
    background: #4c4c4c;
}

.event-info {
    display: block;
    margin: 18px 0;
}

.event-info-table {
    width: 100%;
    display: grid;
    gap: 8px;
}

.event-info-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #262626;
    border: 1px solid #3a3a3a;
}

.event-info-key {
    color: #ffffff;
    font-weight: 600;
}

.event-info-value {
    color: #e2e2e2;
    min-width: 0;
    word-break: break-word;
}

.event-info-value-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.event-inline-edit-btn {
    padding: 3px 14px;
    min-width: auto;
    font-size: 0.85em;
    background: #3f3f3f;
    color: #fff;
    border: 1px solid #5a5a5a;
}

.event-inline-edit-btn:hover {
    background: #545454;
}

.event-link-copy-btn {
    padding: 3px 14px;
    font-size: 0.82em;
    line-height: 1.1;
    white-space: nowrap;
}

.info-item .label {
    min-width: 80px;
    color: #ffffff;
    font-weight: 600;
}

.info-item .value {
    color: #e2e2e2;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mission-section {
    margin-top: 16px;
}

.event-detail-note {
    margin: 0 0 10px;
    color: #bbbbbb;
    font-size: 0.9em;
}

.event-input-help {
    margin-top: 6px;
    color: #b8b8b8;
    font-size: 0.82em;
    line-height: 1.3;
}

.mission-card {
    background: #242424;
    border: 1px solid #3d3d3d;
    border-radius: 10px;
    padding: 12px;
}

.mission-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.mission-text {
    color: #e8e8e8;
    text-align: left;
}

.mission-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    gap: 10px;
}

.mission-accordion-icon {
    color: #bfc7d4;
    font-size: 0.95em;
    line-height: 1;
    transition: transform 0.2s ease;
}

.mission-accordion-toggle[aria-expanded="false"] .mission-accordion-icon {
    transform: rotate(-90deg);
}

.mission-accordion-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #373737;
}

.mission-accordion-panel.is-collapsed {
    display: none;
}

.mission-link {
    color: #8fb8ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mission-link:hover {
    color: #bfd5ff;
}

.participant-text-input {
    width: 100%;
    min-height: 92px;
    resize: vertical;
}

.mission-meta-block {
    margin-top: 2px;
    font-size: 13px;
}

.mission-meta-list {
    margin: 6px 0 0 16px;
}

.mission-meta-empty {
    margin-top: 4px;
    color: #9f9f9f;
    font-size: 12px;
}

.mission-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.mission-actions .event-detail-btn-sm {
    white-space: nowrap;
}

.empty-missions {
    text-align: center;
    color: #cfcfcf;
    background: #242424;
    border: 1px solid #3d3d3d;
    border-radius: 10px;
    padding: 24px;
}

.modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    z-index: 1000;
}

#missionModal[style*="display: flex"],
#scheduleModal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    width: min(90vw, 560px);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    padding: 18px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.close {
    font-size: 24px;
    cursor: pointer;
}

.modal-body .form-group {
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .nav-login {
        flex-direction: column;
        gap: 8px;
    }

    .login-box {
        padding: 30px 20px;
    }

    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .event-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .event-detail-item {
        gap: 4px;
    }

    .event-detail-item strong {
        min-width: auto;
    }

    .event-details {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px 10px;
    }

    .event-register-btn {
        width: 100%;
    }

    .mission-row {
        flex-direction: column;
    }

    .mission-type {
        width: 100%;
        min-width: 0;
    }

    .event-info-row {
        grid-template-columns: 120px minmax(0, 1fr);
        padding: 7px 8px;
    }

    .event-inline-edit-btn {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }

    .mission-section>.section-header {
        display: grid;
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }

    .mission-section>.section-header h3 {
        margin: 0;
    }

    .mission-section>.section-header .event-detail-btn-sm {
        width: 100%;
    }

    .mission-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .mission-actions {
        width: 100%;
    }

    .event-detail-actions {
        flex-wrap: wrap;
    }

    .channel-select-row {
        flex-direction: column;
        align-items: stretch;
    }

    .channel-select-row #channelSelect {
        min-width: 0;
    }

    .channel-select-row .event-manage-btn {
        width: 100%;
        display: block;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .event-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .event-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
