/* ========================================
   MODALS - Overlays, Instructions, Pickers
   ======================================== */

/* Instructions Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

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

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

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 25px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Large Modal - 50% Bigger */
.modal-content-large {
    max-width: 900px;
    width: 95%;
    padding: 60px;
    animation: modalPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgb(30, 30, 52);
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0px rgba(102, 126, 234, 0.4);
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px) rotateX(-10deg);
    }
    50% {
        transform: scale(1.05) translateY(-10px) rotateX(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stylized Red Close Button */
.modal-close {
    background: rgba(252, 129, 129, 0.2);
    color: #fc8181;
    border: 2px solid rgba(252, 129, 129, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.modal-close:hover {
    background: rgba(252, 129, 129, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 5px 3px rgba(252, 129, 129, 0.4);
}

.modal-content-large .modal-header {
    margin-bottom: 35px;
    padding-bottom: 25px;
}

.modal-content-large .modal-header h3 {
    font-size: 2.4em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.calendar-settings-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.month-input {
    width: 100%;
    padding: 18px 24px;
    background: rgb(40, 40, 60);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    font-size: 18px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.month-input:hover {
    background: rgb(50, 50, 70);
    border-color: var(--accent-purple);
}

.month-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgb(55, 55, 75);
    box-shadow:
        0 0 0px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.checkbox-group {
    padding: 25px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.checkbox-group:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: var(--accent-purple);
    box-shadow: 0 5px 4px rgba(102, 126, 234, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: var(--accent-purple);
}

.checkbox-text {
    color: var(--text-primary);
    font-size: 1.2em;
}

.calendar-settings-content .btn {
    margin-top: 10px;
    font-size: 20px;
    height: var(--control-height);
    padding: 0 50px;
}

/* Share Modal Enhancements */
#shareModal textarea,
#shareBody {
    width: 100%;
    padding: 14px 18px;
    background: rgb(35, 35, 55);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
}

#shareModal textarea:focus,
#shareBody:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgb(40, 40, 60);
    box-shadow: 0 0 0px rgba(159, 122, 234, 0.3);
}

/* Recycle Bin Modal */
.deleted-calendar-item {
    padding: 20px;
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: none;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.deleted-calendar-item:hover {
    background: rgb(35, 35, 55);
    transform: translateX(5px);
}

.deleted-calendar-info {
    flex: 1;
}

.deleted-calendar-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 5px;
}

.deleted-calendar-date {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Calendar Timestamps */
.calendar-timestamps {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-timestamps p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.timestamp-created {
    color: var(--text-secondary);
}

.timestamp-deleted {
    color: #ff6b6b;
    font-weight: 500;
}

/* Textarea styling for modal */
textarea.month-input {
    min-height: 150px;
    line-height: 1.6;
}

/* Instructions Modal Content Styling */
.instructions-content {
    color: var(--text-primary);
}

.instructions-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.instructions-list li {
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
}

.instructions-list li::before {
    content: '▸';
    position: absolute;
    left: 8px;
    color: var(--accent-purple);
    font-size: 1.2em;
    font-weight: bold;
}

.instruction-highlight {
    color: var(--accent-purple);
    font-weight: 700;
    background: rgba(159, 122, 234, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(159, 122, 234, 0.3);
}

.instruction-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
