/* ========================================
   Apple-Style Glasmorphism Delete Modal
   ======================================== */

:root {
    --apple-red: #ff4757;
    --apple-red-hover: #ff6b7a;
    --apple-gray: #8e8e93;
    --apple-bg: rgba(11, 16, 32, 0.85);
    --apple-surface: rgba(15, 20, 40, 0.85);
    --apple-border: rgba(92, 101, 242, 0.25);
    --apple-shadow: rgba(0, 0, 0, 0.5);
    --apple-text: #ffffff;
    --apple-text-secondary: rgba(176, 179, 197, 0.8);
    --apple-warning: #ffc107;
    --app-primary: #5865F2;
    --app-secondary: #6C63FF;
    --app-accent: #9EA4FF;
}

/* Modal Overlay - Apple-style blur */
.apple-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 18, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.apple-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Container - Glass effect */
.apple-modal {
    background: var(--apple-surface);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 20px;
    border: 1px solid var(--apple-border);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 420px;
    width: 90%;
    margin: 20px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.apple-modal-overlay.show .apple-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal Header */
.apple-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.apple-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.15) 0%, 
        rgba(255, 152, 0, 0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.apple-modal-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.5) 0%, 
        rgba(255, 152, 0, 0.5) 100%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.apple-modal-icon i {
    font-size: 32px;
    color: #ffc107;
    filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.6));
}

.apple-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--apple-text);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.apple-modal-subtitle {
    font-size: 15px;
    color: var(--apple-text-secondary);
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
}

/* Modal Body */
.apple-modal-body {
    padding: 16px 24px 24px;
}

.apple-warning-box {
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.apple-warning-box i {
    color: #ffc107;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.apple-warning-box p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.apple-info-text {
    font-size: 13px;
    color: var(--apple-text-secondary);
    text-align: center;
    margin: 0;
}

.apple-info-text strong {
    color: var(--apple-text);
    font-weight: 600;
}

/* Modal Footer */
.apple-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
}

/* Buttons - Apple style */
.apple-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.2px;
}

.apple-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.apple-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Cancel Button */
.apple-btn-cancel {
    background: rgba(158, 164, 255, 0.15);
    color: var(--app-accent);
    border: 1px solid rgba(92, 101, 242, 0.3);
}

.apple-btn-cancel:hover {
    background: rgba(158, 164, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 101, 242, 0.25);
}

.apple-btn-cancel:active {
    transform: translateY(0);
}

/* Delete Button */
.apple-btn-delete {
    background: linear-gradient(135deg, 
        var(--apple-red) 0%, 
        #ff2d55 100%);
    color: white;
    box-shadow: 
        0 4px 12px rgba(255, 59, 48, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.apple-btn-delete:hover {
    background: linear-gradient(135deg, 
        var(--apple-red-hover) 0%, 
        #ff3b5c 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(255, 59, 48, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.apple-btn-delete:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(255, 59, 48, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.apple-btn i {
    margin-left: 6px;
    position: relative;
    z-index: 1;
}

/* Close Button */
.apple-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(92, 101, 242, 0.15);
    border: 1px solid rgba(92, 101, 242, 0.2);
    color: var(--app-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.apple-modal-close:hover {
    background: rgba(92, 101, 242, 0.3);
    color: var(--apple-text);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(92, 101, 242, 0.4);
}

.apple-modal-close i {
    font-size: 14px;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.apple-modal.shake {
    animation: shake 0.5s;
}

/* Responsive */
@media (max-width: 480px) {
    .apple-modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .apple-modal-header {
        padding: 20px 20px 12px;
    }
    
    .apple-modal-icon {
        width: 56px;
        height: 56px;
    }
    
    .apple-modal-icon i {
        font-size: 28px;
    }
    
    .apple-modal-title {
        font-size: 18px;
    }
    
    .apple-modal-footer {
        flex-direction: column-reverse;
        padding: 12px 20px 20px;
    }
    
    .apple-btn {
        width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .apple-modal {
        background: var(--apple-surface);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.5),
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* Accessibility */
.apple-modal:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

.apple-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .apple-modal-overlay,
    .apple-modal,
    .apple-btn {
        transition: none;
    }
    
    .apple-btn::before {
        display: none;
    }
}

