/**
 * Modal Styles for Notes V2
 * 
 * Styles for modal overlay and container
 */

/* ==========================================================================
   Modal Container
   ========================================================================== */

.patns-v2-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.patns-v2-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.patns-v2-modal {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    animation: patnsV2ModalFadeIn 0.2s ease-out;
}

@keyframes patnsV2ModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.patns-v2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    gap: 20px;
    position: relative;
    min-height: 70px;
}

.patns-v2-modal-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.patns-v2-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.patns-v2-modal-note-count {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
}

.patns-v2-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.patns-v2-modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.patns-v2-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* ==========================================================================
   Modal Body
   ========================================================================== */

.patns-v2-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.patns-v2-modal-loading {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 16px;
}

/* Custom scrollbar for modal body */
.patns-v2-modal-body::-webkit-scrollbar {
    width: 8px;
}

.patns-v2-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.patns-v2-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.patns-v2-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Modal Create Note Section
   ========================================================================== */

.patns-v2-create-note-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

/* ==========================================================================
   Body Lock (Prevent scrolling when modal is open)
   ========================================================================== */

body.patns-v2-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .patns-v2-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .patns-v2-modal-header {
        padding: 15px 20px;
    }
    
    .patns-v2-modal-title {
        font-size: 20px;
    }
    
    .patns-v2-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .patns-v2-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.patns-v2-modal-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.patns-v2-modal-close:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .patns-v2-modal {
        animation: none;
    }
}

