/* Modern Sleek Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 90%;
    transform: scale(0.9) translateY(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: none;
    position: relative;
}

.popup-overlay.show .popup-container {
    transform: scale(1) translateY(0);
}

.popup-header {
    background: #5a7a52;
    color: white;
    padding: 16px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
    position: relative;
    z-index: 1;
    letter-spacing: -0.3px;
}

.popup-body {
    padding: 32px;
    text-align: left;
    background: #ffffff;
}

.popup-message {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 24px;
    font-weight: 500;
}

.popup-button {
    background: #5a7a52;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.popup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.popup-button:hover::before {
    left: 100%;
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(90, 122, 82, 0.3);
    background: #4a6a42;
}

.popup-button:active {
    transform: translateY(0);
}

.popup-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 122, 82, 0.3);
}

/* Secondary button variant */
.popup-button-secondary {
    background: #f8fafc !important;
    color: #64748b !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.popup-button-secondary:hover {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

.popup-button-secondary:focus {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2) !important;
}

/* Input styles for edit popup */
#edit-title-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
}

#edit-title-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbff;
}

#edit-title-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Success variant */
.popup-container.success .popup-header {
    background: linear-gradient(135deg, #017223 0%, #019a2e 100%);
}

.popup-container.success .popup-button {
    background: linear-gradient(135deg, #017223 0%, #019a2e 100%);
}

.popup-container.success .popup-button:hover {
    background: linear-gradient(135deg, #015a1c 0%, #017223 100%);
}

.popup-container.success .popup-button:focus {
    box-shadow: 0 0 0 3px rgba(1, 114, 35, 0.3);
}

/* Error variant */
.popup-container.error .popup-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.popup-container.error .popup-button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.popup-container.error .popup-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.popup-container.error .popup-button:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* Warning variant */
.popup-container.warning .popup-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.popup-container.warning .popup-button {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.popup-container.warning .popup-button:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.popup-container.warning .popup-button:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

/* Info variant */
.popup-container.info .popup-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.popup-container.info .popup-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.popup-container.info .popup-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.popup-container.info .popup-button:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Loading animation */
.popup-button.loading {
    position: relative;
    color: transparent;
}

.popup-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 480px) {
    .popup-container {
        width: 95%;
        margin: 20px;
    }
    
    .popup-header {
        padding: 20px 20px 16px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-icon {
        width: 50px;
        height: 50px;
    }
    
    .popup-icon .material-icons {
        font-size: 24px;
    }
    
    .popup-title {
        font-size: 18px;
    }
    
    .popup-message {
        font-size: 15px;
    }
    
    .popup-button {
        padding: 10px 24px;
        font-size: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .popup-container {
        background: #1f2937;
        color: white;
    }
    
    .popup-message {
        color: #d1d5db;
    }
}
