/* Select Exercise Page Styles */
body {
    transition: opacity 0.5s ease;
}

.select-exercise-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 2vh;
    min-height: 100vh;
    gap: 30px;
    max-height: 95vh;
    overflow-y: auto;
}

.page-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(120deg, #b956e3, #8a40b9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fade-in 0.8s ease forwards;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    /* background: linear-gradient(90deg, transparent, rgba(185, 86, 227, 0.7), transparent); */
    transform: translateX(-50%);
    animation: title-underline 2s ease-in-out forwards;
}

@keyframes title-underline {
    0% {
        width: 0;
    }
    100% {
        width: 200px;
    }
}

.exercise-content {
    display: flex;
    width: 100%;
    max-width: 1000px;
    gap: 30px;
    animation: fade-in 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
    height: auto;
    max-height: 80vh;
}

/* Left Panel Styles */
.options-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 280px;
}

.option-button {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
}

.option-button span {
    cursor: pointer;
}

.option-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    z-index: -1;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.option-button:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.option-button:hover::before {
    transform: translateX(0);
}

.option-button.active {
    background: rgba(185, 86, 227, 0.2);
    border-color: rgba(185, 86, 227, 0.5);
    box-shadow: 0 0 15px rgba(185, 86, 227, 0.3);
}

.option-button.primary {
    background: linear-gradient(135deg, rgba(185, 86, 227, 0.6), rgba(138, 43, 226, 0.6));
    color: white;
    position: relative;
    overflow: hidden;
}

.option-button.primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.5s;
}

.option-button.primary:hover {
    background: linear-gradient(135deg, rgba(185, 86, 227, 0.8), rgba(138, 43, 226, 0.8));
}

.option-button.primary:hover::after {
    opacity: 1;
    transform: scale(1);
}

.option-button.leetcode {
    background: linear-gradient(135deg, rgba(237, 129, 40, 0.4), rgba(90, 90, 90, 0.4));
    color: white;
}

.option-button.leetcode:hover {
    background: linear-gradient(135deg, rgba(237, 129, 40, 0.6), rgba(90, 90, 90, 0.6));
    box-shadow: 0 0 15px rgba(237, 129, 40, 0.3);
}

.option-button.leetcode.active {
    background: rgba(237, 129, 40, 0.3);
    border-color: rgba(237, 129, 40, 0.5);
    box-shadow: 0 0 15px rgba(237, 129, 40, 0.3);
}

/* Right Panel Styles */
.content-panel {
    flex: 1;
    background: rgba(23, 26, 23, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(5px);
    box-shadow: 10px 10px 0 rgba(23, 26, 23, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    max-height: 500px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.content-panel:hover {
    box-shadow: 15px 15px 0 rgba(23, 26, 23, 0.15);
}

/* Search Bar */
.search-container {
    margin-bottom: 15px;
    width: 100%;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.085);
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: text;
}

.search-input:focus {
    outline: none;
    border-color: rgba(185, 86, 227, 0.5);
    box-shadow: 0 0 0 2px rgba(185, 86, 227, 0.2);
}

.search-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    /* background: linear-gradient(90deg, rgba(185, 86, 227, 0.7), rgba(237, 129, 40, 0.7)); */
    transition: width 0.3s ease;
}

.search-container:focus-within::after {
    width: 100%;
}

/* Problems List */
.problems-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 10px;
    padding-bottom: 60px; /* Space for the launch button */
    width: 100%; /* Ensure it takes full width of container */
}

.problem-item {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.problem-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.problem-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.problem-item:hover::before {
    transform: translateX(100%);
}

.problem-item.selected {
    background: rgba(185, 86, 227, 0.15);
    border-left: 3px solid rgba(185, 86, 227, 0.8);
    box-shadow: 0 0 10px rgba(185, 86, 227, 0.2);
}

.problem-item.selected:hover {
    background: rgba(185, 86, 227, 0.2);
}

.problem-info {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.problem-number {
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    min-width: 30px;
}

.problem-name {
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.9);
}

.difficulty {
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.difficulty::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.5;
    filter: blur(8px);
    z-index: -1;
    transition: opacity 0.3s ease;
}

.difficulty.easy {
    background-color: rgba(0, 184, 163, 0.2);
    color: rgb(0, 184, 163);
}

.difficulty.medium {
    background-color: rgba(255, 192, 30, 0.2);
    color: rgb(255, 192, 30);
}

.difficulty.hard {
    background-color: rgba(239, 71, 67, 0.2);
    color: rgb(239, 71, 67);
}

/* Upload Area */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    height: 300px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-bottom: 60px; /* Space for launch button */
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(185, 86, 227, 0.05) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.8s;
}

.upload-area.highlight {
    border-color: rgba(185, 86, 227, 0.5);
    background: rgba(185, 86, 227, 0.05);
    box-shadow: 0 0 20px rgba(185, 86, 227, 0.15);
}

.upload-area.highlight::before {
    opacity: 1;
    transform: scale(1);
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.upload-icon {
    width: 70px;
    height: 70px;
    fill: rgba(185, 86, 227, 0.7);
    margin-bottom: 15px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 5px rgba(185, 86, 227, 0.3));
}

.upload-area.highlight .upload-icon {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 0 8px rgba(185, 86, 227, 0.5));
}

.upload-area p {
    font-family: 'Montserrat', sans-serif;
    color: rgba(255, 255, 255, 0.7);
}

.upload-button {
    background: rgba(185, 86, 227, 0.2);
    border: 1px solid rgba(185, 86, 227, 0.4);
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.upload-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.upload-button:hover {
    background: rgba(185, 86, 227, 0.3);
    transform: translateY(-2px);
}

.upload-button:hover::before {
    left: 100%;
}

/* Custom Problem Area */
.custom-problem-area {
    height: auto;
    width: 100%;
    margin-bottom: 60px; /* Space for launch button */
    position: relative;
}

.custom-problem-area textarea {
    height: 250px;
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    resize: none;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
}

.custom-problem-area textarea:focus {
    outline: none;
    border-color: rgba(185, 86, 227, 0.5);
    box-shadow: 0 0 0 2px rgba(185, 86, 227, 0.2);
}

/* Launch Button */
.launch-button-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    z-index: 10;
}

.launch-button {
    background: transparent;
    color: white;
    border: 2px solid rgba(185, 86, 227, 0.8);
    border-radius: 8px;
    padding: 10px 40px; /* Wider padding */
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    min-width: 180px; /* Set minimum width */
    
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    opacity: 1; /* Always visible */
    transform: translateY(0); /* No initial transform */
    pointer-events: all; /* Always clickable */
}

.launch-button::before {
    content: '';
    position: absolute;
    inset: -5px;
    background: linear-gradient(90deg, 
        rgba(185, 86, 227, 0), 
        rgba(185, 86, 227, 0.8), 
        rgba(138, 43, 226, 0.8), 
        rgba(138, 43, 226, 0));
    z-index: -1;
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.launch-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    animation: slide-shine 3s 0.5s infinite;
}

.launch-button:hover {
    background: rgba(185, 86, 227, 0.2);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.launch-button:hover::before {
    opacity: 1;
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    0% {
        opacity: 0.5;
        filter: blur(8px);
    }
    100% {
        opacity: 0.8;
        filter: blur(12px);
    }
}

@keyframes slide-shine {
    0% {
        transform: translateX(-100%);
    }
    20%, 100% {
        transform: translateX(100%);
    }
}

/* Navigation Controls */
.navigation-controls {
    display: none;
}

/* Custom Scrollbar */
.problems-list::-webkit-scrollbar {
    width: 6px;
}

.problems-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.problems-list::-webkit-scrollbar-thumb {
    background: rgba(185, 86, 227, 0.3);
    border-radius: 3px;
}

.problems-list::-webkit-scrollbar-thumb:hover {
    background: rgba(185, 86, 227, 0.5);
}

/* Water-like effect animations */
@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(185, 86, 227, 0.3);
    }
    100% {
        box-shadow: 0 0 0 20px rgba(185, 86, 227, 0);
    }
}

/* Media Queries */
@media (max-width: 1024px) {
    .exercise-content {
        flex-direction: column;
        align-items: center;
        max-height: none;
    }
    
    .options-panel {
        width: 100%;
        max-width: 500px;
    }
    
    .launch-button-container {
        position: relative;
        width: 100%;
        bottom: auto;
        margin-top: 20px;
    }
    
    .launch-button {
        width: 100%;
    }
    
    .content-panel {
        max-height: none;
    }
    
    .problems-list, .custom-problem-area, .upload-area {
        margin-bottom: 0; /* No need for extra space with repositioned button */
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    .content-panel {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }
    
    .problem-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .difficulty {
        align-self: flex-start;
    }
}

/* Additional element interactions */