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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00ff88;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-btn.active {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

.filter-btn:active {
    transform: scale(0.95);
}

.view-toggle {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.view-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.view-btn.active {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

.view-btn:active {
    transform: scale(0.95);
}

#skillsContainer.list-view {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

#skillsContainer.list-view .skill-node {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-align: left;
}

#skillsContainer.list-view .skill-node .skill-icon {
    font-size: 1.8rem;
    margin-bottom: 0;
    margin-right: 15px;
}

#skillsContainer.list-view .skill-node .skill-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#skillsContainer.list-view .skill-node .skill-name {
    font-size: 1rem;
    margin-bottom: 0;
}

#skillsContainer.list-view .skill-node .skill-category {
    font-size: 0.75rem;
    margin-bottom: 0;
}

#skillsContainer.list-view .skill-node .skill-status {
    margin-left: auto;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    color: #1a1a2e;
}

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

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: scale(0.95);
}

.skill-map {
    position: relative;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke: #444;
    stroke-width: 2;
    fill: none;
    transition: stroke 0.3s ease;
}

.connection-line.unlocked {
    stroke: #00ff88;
    stroke-width: 3;
    filter: drop-shadow(0 0 5px #00ff88);
}

#skillsContainer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.skill-node {
    position: relative;
    width: 180px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.skill-node:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 217, 255, 0.5);
}

.skill-node:active {
    transform: scale(0.95);
}

.skill-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skill-node.locked:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.skill-node.locked:active {
    transform: none;
}

.skill-node.unlocked {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.skill-node.current {
    border-color: #00d9ff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.6);
    }
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.skill-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.skill-category {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
}

.skill-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.skill-status.locked {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}

.skill-status.current {
    background: rgba(0, 217, 255, 0.2);
    color: #00d9ff;
}

.skill-status.unlocked {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #fff;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #00d9ff;
}

#modalBody {
    color: #ccc;
    line-height: 1.6;
}

.skill-detail {
    margin-bottom: 15px;
}

.skill-detail-label {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.skill-detail-value {
    color: #fff;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d9ff;
}

.form-group textarea {
    resize: vertical;
}

.unlock-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
}

.unlock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

    header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .stats {
        gap: 15px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .controls {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 0.95rem;
        width: 100%;
        max-width: 300px;
    }

    .filter-container {
        gap: 6px;
        margin-bottom: 15px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .view-toggle {
        display: flex;
    }

    .skill-map {
        padding: 20px 10px;
        min-height: auto;
    }

    #connections {
        display: none;
    }

    #skillsContainer {
        gap: 15px;
    }

    .skill-node {
        width: calc(50% - 8px);
        padding: 15px 10px;
        min-width: 140px;
    }

    .skill-icon {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }

    .skill-name {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }

    .skill-category {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .skill-status {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .skill-detail {
        margin-bottom: 12px;
    }

    .skill-detail-label {
        font-size: 0.8rem;
    }

    .skill-detail-value {
        font-size: 0.95rem;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 0.95rem;
    }

    .unlock-btn {
        padding: 14px;
        font-size: 1rem;
        margin-top: 15px;
    }

    .close {
        font-size: 24px;
        right: 15px;
        top: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .skill-node {
        width: calc(50% - 6px);
        padding: 12px 8px;
        min-width: 130px;
    }

    .skill-icon {
        font-size: 2rem;
    }

    .skill-name {
        font-size: 0.85rem;
    }

    .skill-category {
        font-size: 0.65rem;
    }

    .skill-status {
        padding: 2px 6px;
        font-size: 0.6rem;
    }

    .modal-content {
        padding: 15px;
    }

    .modal-content h2 {
        font-size: 1.2rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .skill-node:hover {
        transform: none;
    }

    .skill-node:active {
        transform: scale(0.98);
    }

    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .unlock-btn:hover {
        transform: none;
    }

    .unlock-btn:active {
        transform: scale(0.98);
    }
}
