/* 로오히 유니버스 - 영웅 도감 스타일시트 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.header h1 {
    color: white;
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.search-section {
    margin-bottom: 20px;
    position: relative;
    animation: fadeIn 1s ease 0.15s both;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1em;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.search-input:focus {
    border-color: rgba(255,255,255,0.6);
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.search-input::placeholder {
    color: #999;
}

.clear-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(118, 75, 162, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1.2em;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-button.show {
    display: flex;
}

.clear-button:hover {
    background: rgba(118, 75, 162, 1);
    transform: translateY(-50%) scale(1.1);
}

.effect-filter-section {
    margin-bottom: 15px;
    animation: fadeIn 1s ease 0.18s both;
}

.effect-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.effect-filter-button {
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.85);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.effect-filter-button:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.effect-filter-button.active {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #764ba2;
    font-weight: 600;
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.filter-section {
    margin-bottom: 30px;
    animation: fadeIn 1s ease 0.2s both;
}

.filter-group {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-title {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    min-width: 80px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.filter-button {
    padding: 6px 16px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
    font-weight: 500;
}

.filter-button:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.filter-button.active {
    background: white !important;
    color: #764ba2 !important;
    font-weight: bold;
    border-color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Element colors - 채도 낮춤 */
.element-dark { background: linear-gradient(135deg, #4a4265, #2d2640) !important; }
.element-fire { background: linear-gradient(135deg, #d66b7a, #c65a62) !important; }
.element-water { background: linear-gradient(135deg, #72b8db, #5aa8c9) !important; }
.element-earth { background: linear-gradient(135deg, #5f9f8e, #4d8c7a) !important; }
.element-light { background: linear-gradient(135deg, #d9c493, #c9b682) !important; color: #333 !important; }

.hero-count {
    text-align: center;
    color: white;
    font-size: 1.1em;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.card-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hero-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.hero-header {
    padding: 12px 20px;
    color: white;
    font-weight: bold;
    text-align: center;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.skill-container {
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.normal-skills-row,
.special-skills-row,
.artifacts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 영웅 필터만 접기/펴기 */
.hero-filter-toggle {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
}

.hero-filter-toggle::after {
    content: ' ▶';
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.hero-filter-group.expanded .hero-filter-toggle::after {
    transform: rotate(90deg);
}

.hero-filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.hero-filter-group.expanded .hero-filter-content {
    max-height: 1500px;
}

.hero-filter-content .filter-buttons {
    margin-top: 10px;
}

.skill-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.skill-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 스킬/아티팩트 헤더: 제목과 배지를 같은 행에 배치 */
.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.skill-name {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.75em;
    flex: 1;
}

.skill-cooldown {
    display: inline-block;
    padding: 3px 10px;
    background: #fef08a;
    color: #854d0e;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    flex-shrink: 0;
}


.skill-description {
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
    font-size: 0.75em;
}

.skill-description strong {
    color: #444;
    font-size: 0.85em;
}

/* 스킬 설명 하이라이트 */
.skill-keyword-blue {
    color: #4a9eff;
    font-weight: bold;
}

.skill-keyword-red {
    color: #dc3545;
    font-weight: bold;
}

.skill-keyword-yellow {
    color: #d4a500;
    font-weight: bold;
}

.skill-highlight {
    color: #ff6b00;
    font-weight: 600;
}

.search-highlight {
    background-color: #ffeb3b;
    color: #000;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

.skill-level {
    font-size: 0.65em;
    color: #aaa;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    margin-top: 6px;
}

.skill-level-item {
    display: block;
    margin: 1px 0;
    line-height: 1.3;
}

/* 2행(특수 스킬): 커맨더 있으면 4열 */
.special-skills-row.has-commander {
    grid-template-columns: repeat(4, 1fr);
}

.artifact-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.65em;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.artifact-normal {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

.artifact-noble {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.artifact-relic {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    color: white;
}
.commander-skill-badge {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    color: white;
}

.passive-skill-badge {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.potential-skill-badge {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .normal-skills-row,
    .special-skills-row,
    .artifacts-row {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 태블릿: 커맨더 있어도 2열로 제한 */
    .special-skills-row.has-commander {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header h1 { font-size: 2em; }

    /* 모바일: 모든 행 1열 */
    .normal-skills-row,
    .special-skills-row,
    .special-skills-row.has-commander,
    .artifacts-row {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .filter-title {
        min-width: auto;
    }
    .filter-buttons {
        justify-content: flex-start;
    }
}

/* 공유 버튼 스타일 */
.share-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    opacity: 0.7;
}

.share-button svg {
    transition: all 0.25s ease;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.25);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.share-button:active {
    transform: translateY(-50%) scale(0.9);
}

.share-button.copied {
    background: rgba(76, 175, 80, 0.9);
}

.share-button.copied svg {
    display: none;
}

/* 툴팁 말풍선 */
.share-button::before {
    content: '공유하기';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.share-button::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 2px;
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.share-button:hover::before,
.share-button:hover::after {
    opacity: 1;
}

.share-button.copied::before {
    content: '복사됨!';
    opacity: 1;
}

.hero-header {
    position: relative;
}

/* 공유 알림 토스트 */
.share-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    z-index: 10000;
    animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 2.7s;
    font-weight: 600;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 10px 40px rgba(255,255,255,0.3);
    }
}
