/* Custom styles for Course Generator */

/* Line clamp utilities */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Height utility */
.h-18 {
    height: 4.5rem;
}

/* Editable styling */
.editable, .editable-objective {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.editable:hover, .editable-objective:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.25rem;
}

[data-theme="dark"] .editable:hover,
[data-theme="dark"] .editable-objective:hover {
    background-color: rgba(96, 165, 250, 0.15);
}

.editable::after, .editable-objective::after {
    content: '✎';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(59, 130, 246, 0.6);
    opacity: 0;
    transition: opacity 0.2s;
}

[data-theme="dark"] .editable::after,
[data-theme="dark"] .editable-objective::after {
    color: rgba(96, 165, 250, 0.8);
}

.editable:hover::after, .editable-objective:hover::after {
    opacity: 1;
}

/* Simplified objective item styling */
.objective-item {
    margin: 2px 0;
}

/* Module plus buttons styling */
.module-item {
    position: relative;
}

/* Add hover zones for better UX */
.module-item::before,
.module-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 20px;
    z-index: 5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.module-item::before {
    top: -10px;
}

.module-item::after {
    bottom: -10px;
}

.module-item:hover::before,
.module-item:hover::after {
    background-color: rgba(4, 120, 87, 0.1);
    border: 1px dashed rgba(4, 120, 87, 0.3);
    border-radius: 4px;
}

[data-theme="dark"] .module-item:hover::before,
[data-theme="dark"] .module-item:hover::after {
    background-color: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
}

.module-plus-button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background-color: #047857;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    line-height: 1;
}

.module-plus-button:hover {
    background-color: #064e3b;
    transform: translateX(-50%) scale(1.1);
}

.module-plus-button.plus-above {
    top: -12px;
    bottom: auto;
}

.module-plus-button.plus-below {
    bottom: -12px;
    top: auto;
}

.module-item:hover .module-plus-button {
    opacity: 1;
}

/* Module edit button styling */
.module-edit-button {
    position: absolute;
    bottom: 8px;
    right: 44px;
    width: 28px;
    height: 28px;
    background-color: #2563eb;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.module-edit-button:hover {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

.module-item:hover .module-edit-button {
    opacity: 1;
}

/* Module delete button styling */
.module-delete-button {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background-color: #dc2626;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.module-delete-button:hover {
    background-color: #b91c1c;
    transform: scale(1.1);
}

.module-item:hover .module-delete-button {
    opacity: 1;
}

/* Lesson item styling */
.lesson-item {
    position: relative;
}

/* Lesson hover zones for better UX */
.lesson-item::before,
.lesson-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 15px;
    z-index: 5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lesson-item::before {
    top: -8px;
}

.lesson-item::after {
    bottom: -8px;
}

.lesson-item:hover::before,
.lesson-item:hover::after {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 4px;
}

[data-theme="dark"] .lesson-item:hover::before,
[data-theme="dark"] .lesson-item:hover::after {
    background-color: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.4);
}

/* Lesson plus buttons styling */
.lesson-plus-button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background-color: #10b981;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    line-height: 1;
}

.lesson-plus-button:hover {
    background-color: #059669;
    transform: translateX(-50%) scale(1.1);
}

.lesson-plus-button.plus-above {
    top: -10px;
    bottom: auto;
}

.lesson-plus-button.plus-below {
    bottom: -10px;
    top: auto;
}

.lesson-item:hover .lesson-plus-button {
    opacity: 1;
}

/* Lesson edit button styling */
.lesson-edit-button {
    position: absolute;
    bottom: 4px;
    right: 32px;
    width: 24px;
    height: 24px;
    background-color: #2563eb;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.lesson-edit-button:hover {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

.lesson-item:hover .lesson-edit-button {
    opacity: 1;
}

/* Lesson delete button styling */
.lesson-delete-button {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background-color: #dc2626;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.lesson-delete-button:hover {
    background-color: #b91c1c;
    transform: scale(1.1);
}

.lesson-item:hover .lesson-delete-button {
    opacity: 1;
}

/* Blueprint item styling */
.blueprint-item {
    position: relative;
}

/* Blueprint hover zones for better UX */
.blueprint-item::before,
.blueprint-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    z-index: 5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.blueprint-item::before {
    top: -6px;
}

.blueprint-item::after {
    bottom: -6px;
}

.blueprint-item:hover::before,
.blueprint-item:hover::after {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.3);
    border-radius: 4px;
}

[data-theme="dark"] .blueprint-item:hover::before,
[data-theme="dark"] .blueprint-item:hover::after {
    background-color: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
}

/* Blueprint plus buttons styling */
.blueprint-plus-button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background-color: #f59e0b;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    line-height: 1;
}

.blueprint-plus-button:hover {
    background-color: #d97706;
    transform: translateX(-50%) scale(1.1);
}

.blueprint-plus-button.plus-above {
    top: -9px;
    bottom: auto;
}

.blueprint-plus-button.plus-below {
    bottom: -9px;
    top: auto;
}

.blueprint-item:hover .blueprint-plus-button {
    opacity: 1;
}

/* Blueprint edit button styling */
.blueprint-edit-button {
    position: absolute;
    bottom: 2px;
    right: 24px;
    width: 20px;
    height: 20px;
    background-color: #f59e0b;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.blueprint-edit-button:hover {
    background-color: #d97706;
    transform: scale(1.1);
}

.blueprint-item:hover .blueprint-edit-button {
    opacity: 1;
}

/* Blueprint delete button styling */
.blueprint-delete-button {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: #dc2626;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.blueprint-delete-button:hover {
    background-color: #b91c1c;
    transform: scale(1.1);
}

.blueprint-item:hover .blueprint-delete-button {
    opacity: 1;
}

/* Transition for expanders */
.module-content, .lesson-content {
    transition: all 0.3s ease-in-out;
}

/* Focus styles for form elements */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Custom scrollbar for JSON editor */
#json-editor {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#json-editor::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#json-editor::-webkit-scrollbar-track {
    background: transparent;
}

#json-editor::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

[data-theme="dark"] #json-editor {
    scrollbar-color: rgba(107, 114, 128, 0.5) transparent;
}

[data-theme="dark"] #json-editor::-webkit-scrollbar-thumb {
    background-color: rgba(107, 114, 128, 0.6);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Ensure modals are on top */
#edit-field-modal,
#json-editor-modal,
#regenerate-modal {
    z-index: 50;
}