/* ll-exercises.css */

/* Prevent scrolling when modal is open */
body.ll-modal-open {
    overflow: hidden;
}

/* --- Modal Styles --- */
.ll-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ll-modal-content {
    background-color: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    /* overflow: hidden; */ /* Removed to prevent clipping of positioned elements */
    padding: 0; /* Padding is now handled by inner elements */
}

/* Specific styles for the exercise modal content */
.ll-exercise-modal-content {
    min-width: 600px;
    text-align: left;
}

.ll-modal-body {
    flex: 1 1 auto; /* Allow the body to grow and shrink */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Crucial for flex children sizing */
    padding: 0;
}

/* --- Exercise Modal Layout --- */
#ll-exercise-react-root {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ll-exercise-header {
    flex-shrink: 0;
    padding: 24px 24px 0;
}

.ll-exercise-body {
    flex: 1 1 auto; /* Allow this to be the growing, scrollable area */
    overflow-y: auto;
    min-height: 0;
    padding: 16px 24px;
}

.ll-exercise-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid #eee;
}

.ll-exercise-container-react {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0; /* Crucial for nested flex containers */
}

.ll-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background-color: #FF535C !important;
    border-radius: 50%;
    border: none;
    color: white !important;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.ll-modal-close:hover {
    background-color: #3a666e;
    transform: scale(1.1);
}

.ll-modal-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
}

.ll-modal-option:hover {
    border-color: #FAA576;
    background-color: #fff8f5;
}

.ll-modal-icon-container {
    margin-right: 15px;
}

.ll-modal-icon {
    color: #FAA576;
}

.ll-modal-option-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #555;
}

.ll-modal-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin: 20px 0;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

.ll-modal-separator::before,
.ll-modal-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.ll-modal-separator:not(:empty)::before {
    margin-right: .5em;
}

.ll-modal-separator:not(:empty)::after {
    margin-left: .5em;
}

.ll-theme-dropdown {
    width: 100%;
    padding: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    font-size: 1.1rem;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cccccc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: .65em auto;
}

.ll-modal-footer {
    display: none; /* Hidden on desktop */
}

.ll-modal-status {
    margin-top: 15px;
    font-weight: bold;
}
.ll-modal-status.success { color: #28a745; }
.ll-modal-status.error { color: #dc3545; }

/* --- Modal Title --- */
.ll-modal-title {
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* --- Responsive Styles for Mobile --- */
/* Loading Spinner and Overlay */
.ll-loading-overlay-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.ll-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #007a87; /* Dark Teal */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.ll-loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

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

@media (max-width: 600px) {
    .ll-modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%; /* Ensure it uses full width */
        max-height: 100%; /* Ensure it uses full height */
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    /* Override specific exercise modal content styles for mobile */
    .ll-exercise-modal-content {
        min-width: unset; /* Remove minimum width constraint */
        width: 100%; /* Ensure it uses full width on mobile */
    }

    .ll-modal-footer {
        display: block; /* Show on mobile */
        margin-top: 30px;
    }

    .ll-modal-cancel {
        width: 100%;
        padding: 15px;
        background-color: #6c757d;
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 1.1rem;
        font-weight: bold;
    }

    .ll-modal-close {
        position: absolute;
        top: 52px;
        right: unset;
        left: 2px;
        border-radius: 50% !important;
        padding: 8px 16px !important;
    }    
}


.ll-exercises-container {
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

.ll-exercises-container h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.ll-exercises-container p a {
    color: #0073aa;
    text-decoration: none;
}
.ll-exercises-container p a:hover {
    text-decoration: underline;
}

.ll-exercises-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ll-exercises-item-wrapper {
    margin-bottom: 10px;
}

.ll-exercises-item {
    display: flex;
    align-items: center;
    background-color: #ff6d74; /* Light blue background */
    border-radius: 20px;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
}

.ll-exercises-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.ll-create-exercise-trigger {
    cursor: pointer;
}

.ll-item-number-container {
    margin-right: 15px;
}

.ll-item-number {
    background-color: white;
    color: black;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1em;
}

.ll-item-name {
    flex-grow: 1;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
}

.ll-item-score-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    min-width: 80px;
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
}

.ll-item-score-low {
    background-color: #d9534f; /* Red */
}

.ll-item-score-medium {
    background-color: #f0ad4e; /* Yellow */
}

.ll-item-score-high {
    background-color: #5cb85c; /* Green */
}

.ll-item-status-container {
    min-width: 120px;
    text-align: center;
    color: white;
    font-size: 0.9em;
}

.ll-item-arrow-container {
    margin-left: 15px;
}

.ll-item-arrow {
    font-size: 1.5em;
    color: white;
}

/* --- Exercise Statement Styles --- */
.ll-exercise-statement {
    margin-bottom: 25px !important;
    font-size: 1.25rem;
    font-weight: 500;
    color: black;
}

.ll-exercise-phrase {
    margin-bottom: 24px; /* This creates a controllable space between each phrase */
}

/* Loading Overlay Styles */
.ll-loading-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Cover the entire viewport */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998; /* Below the modal, but above everything else */
    justify-content: center;
    align-items: center;
}

.ll-loading-dots {
    display: flex;
    align-items: center;
}

.ll-loading-dots div {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #fff;
    margin: 0 5px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.ll-loading-dots div:nth-child(1) {
    animation-delay: -0.32s;
}

.ll-loading-dots div:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

/* Ensures the last phrase doesn't have extra space at the bottom */

/* Admin Delete Button Styles */
.palestra-delete-exercise-btn {
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    margin-left: auto; /* Push it to the right */
    margin-right: 15px; /* Space before the score */
    flex-shrink: 0;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.palestra-delete-exercise-btn:hover {
    background-color: #dc3545; /* Red background on hover */
    color: white;
}

.palestra-delete-exercise-btn:hover {
    background-color: #3a666e; /* Darker teal on hover */
}

.palestra-delete-exercise-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.ll-exercise-phrase:last-child {
    margin-bottom: 0;
}

.ll-button-primary {
    background-color: #FF535C !important;
    color: white !important;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.ll-link {
    color: #FF535C;
    text-decoration: none;
}

.ll-link:visited {
    color: #FF535C;
    text-decoration: none;
}