/* Concept Page Specific Styles */

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 64px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.header h1 span {
    color: #818cf8;
}

.header p {
    color: #d1d5db;
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Concept Map Layout */
.concept-map {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.level-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(55, 65, 81, 0.4);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.level-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(79, 70, 229, 0.15));
    border-bottom: 1px solid rgba(55, 65, 81, 0.4);
    padding: 12px 12px;
    text-align: center;
}

.level-title {
    display: inline-block;
    color: #818cf8;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.level-description {
    color: white;
    font-size: 0.95rem;
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

.level {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 32px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

.concept {
    padding: 16px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 500;
    position: relative;
    min-width: 140px;
    font-size: 0.95rem;
    color: white;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.concept:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 25px -5px rgba(99, 102, 241, 0.3), 
        0 10px 10px -5px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.5);
}

.concept.active {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 30px rgba(129, 140, 248, 0.4), 
        0 4px 15px rgba(129, 140, 248, 0.2);
    border: 1px solid rgba(129, 140, 248, 0.6);
}

/* Level-specific styling */
.level-1 {
    background: transparent;
}

.level-1 .concept {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    font-size: 1.25rem;
    padding: 24px 32px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.3);
}

.level-1 .concept:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.level-2 {
    background: transparent;
}

.level-2 .concept {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    font-size: 1.1rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

.level-2 .concept:hover {
    background: linear-gradient(135deg, #4338ca, #312e81);
}

.level-3 {
    background: transparent;
}

.level-3 .concept {
    background: linear-gradient(135deg, #3730a3, #312e81);
    box-shadow: 0 4px 15px rgba(55, 48, 163, 0.2);
}

.level-3 .concept:hover {
    background: linear-gradient(135deg, #312e81, #1e1b4b);
}

.level-4 {
    background: transparent;
}

.level-4 .concept {
    background: linear-gradient(135deg, #312e81, #1e1b4b);
    box-shadow: 0 4px 15px rgba(30, 27, 75, 0.2);
}

.level-4 .concept:hover {
    background: linear-gradient(135deg, #1e1b4b, #1e3a8a);
}

.level-5 {
    background: transparent;
}

.level-5 .concept {
    background: linear-gradient(135deg, #1e1b4b, #1e3a8a);
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
}

.level-5 .concept:hover {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
}

.level-6 {
    background: transparent;
}

.level-6 .concept {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.level-6 .concept:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* Connectors */
.connector {
    width: 2px;
    height: 32px;
    background: linear-gradient(to bottom, #374151, #6b7280);
    margin: 0 auto;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Popup Modal */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.popup-overlay.active .popup {
    transform: translate(-50%, -50%) scale(1);
}

.popup-header {
    padding: 24px 32px 16px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.popup h2 {
    color: white;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #374151;
    color: white;
}

.popup-content {
    padding: 24px 32px 32px;
}

.popup-content h3 {
    color: #d1d5db;
    margin: 24px 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-content h3:first-child {
    margin-top: 0;
}

.popup-content p {
    margin-bottom: 16px;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1.7;
}

.popup-content ul {
    margin: 16px 0;
    padding-left: 0;
}

.popup-content li {
    margin-bottom: 8px;
    color: #9ca3af;
    list-style: none;
    padding-left: 20px;
    position: relative;
}

.popup-content li::before {
    content: '•';
    color: #818cf8;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.wiki-link {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.wiki-link:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.tag {
    display: inline-block;
    background: #374151;
    color: #d1d5db;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 4px 8px 4px 0;
    border: 1px solid #4b5563;
}

.complexity-indicator {
    display: flex;
    align-items: center;
    margin-top: 16px;
    gap: 8px;
}

.complexity-label {
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 500;
}

.complexity-dots {
    display: flex;
    gap: 4px;
}

.complexity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #374151;
}

.complexity-dot.active {
    background: #818cf8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.25rem;
    }

    .header p {
        font-size: 1.1rem;
    }

    .concept {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 14px 20px;
    }

    .level-1 .concept {
        font-size: 1.1rem;
        padding: 20px 24px;
    }

    .popup {
        width: 95%;
        max-height: 85vh;
        margin: 0 2.5%;
    }

    .popup-header,
    .popup-content {
        padding: 20px 24px;
    }

    .popup h2 {
        font-size: 1.5rem;
    }

    .level {
        padding: 16px;
        margin: 0 8px;
    }
}

/* Popup Modal Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.popup-overlay.active .popup {
    transform: translate(-50%, -50%) scale(1);
}

.popup-header {
    padding: 24px 32px 16px;
    border-bottom: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.popup h2 {
    color: white;
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #374151;
    color: white;
}

.popup-content {
    padding: 24px 32px 32px;
}

.popup-content h3 {
    color: #d1d5db;
    margin: 24px 0 12px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-content h3:first-child {
    margin-top: 0;
}

.popup-content p {
    margin-bottom: 16px;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1.7;
}

.popup-content ul {
    margin: 16px 0;
    padding-left: 0;
}

.popup-content li {
    margin-bottom: 8px;
    color: #9ca3af;
    list-style: none;
    padding-left: 20px;
    position: relative;
}

.popup-content li::before {
    content: '•';
    color: #818cf8;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.wiki-link {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.wiki-link:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.tag {
    display: inline-block;
    background: #374151;
    color: #d1d5db;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 4px 8px 4px 0;
    border: 1px solid #4b5563;
}

.complexity-indicator {
    display: flex;
    align-items: center;
    margin-top: 16px;
    gap: 8px;
}

.complexity-label {
    font-size: 0.9rem;
    color: #9ca3af;
    font-weight: 500;
}

.complexity-dots {
    display: flex;
    gap: 4px;
}

.complexity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #374151;
}

.complexity-dot.active {
    background: #818cf8;
}

@media (max-width: 768px) {
    .level-container {
        margin: 0 16px;
    }
    
    .level-header {
        padding: 20px 24px;
    }
    
    .level {
        padding: 24px 20px;
    }
    
    .concept {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 14px 20px;
    }
    
    .level-1 .concept {
        font-size: 1.1rem;
        padding: 20px 28px;
    }
    
    .level-2 .concept {
        font-size: 1rem;
    }
    
    .popup {
        width: 95%;
        max-height: 85vh;
    }
    
    .popup-header,
    .popup-content {
        padding: 20px 24px;
    }
    
    .popup h2 {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
