/* Modern Popup Styles - Universal Theme */
.popup-overlay, .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

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

.popup-content, .modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 30px 35px 25px 35px;
    position: relative;
    text-align: center;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.popup-close, .close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.popup-close:hover, .close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.popup-tabs, #modalTabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 6px;
    backdrop-filter: blur(10px);
}

.popup-tab, #modalTabs button {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.popup-tab::before, #modalTabs button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.popup-tab:hover::before, #modalTabs button:hover::before {
    left: 100%;
}

.popup-tab.active, #modalTabs button.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.popup-body {
    padding: 35px;
    background: white;
}

.popup-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popup-input, .modal input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
    box-sizing: border-box;
}

.popup-input:focus, .modal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 8px 25px rgba(102, 126, 234, 0.15);
    background: white;
    transform: translateY(-2px);
}

.popup-input::placeholder, .modal input::placeholder {
    color: #a0aec0;
    transition: color 0.3s ease;
}

.popup-input:focus::placeholder, .modal input:focus::placeholder {
    color: #667eea;
}

.popup-btn, .modal button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.popup-btn::before, .modal button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.popup-btn:hover::before, .modal button:hover::before {
    left: 100%;
}

.popup-btn:hover, .modal button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.popup-btn:active, .modal button:active {
    transform: translateY(-1px);
}

.popup-btn:disabled, .modal button:disabled {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(203, 213, 224, 0.3);
}

.popup-message, .modal .message {
    min-height: 20px;
    color: #e53e3e;
    font-size: 0.95rem;
    margin-top: 15px;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.2);
    transition: all 0.3s ease;
}

.popup-message.success, .modal .message.success {
    color: #38a169;
    background: rgba(56, 161, 105, 0.1);
    border: 1px solid rgba(56, 161, 105, 0.2);
}

/* Logout Modal Specific Styles */
#logoutModal {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

#logoutModal .modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
}

#logoutModal .modal-header {
    background: linear-gradient(135deg, #e53935 0%, #d32f2f 50%, #c62828 100%);
    color: white;
    padding: 30px 35px 25px 35px;
    position: relative;
    text-align: center;
}

#logoutModal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

#logoutModal .modal-body {
    padding: 35px;
    background: white;
    text-align: center;
}

#logoutModal .modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

#logoutModal .modal-text {
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 30px;
    line-height: 1.6;
}

#logoutModal .modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

#logoutModal .btn-cancel {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.3);
}

#logoutModal .btn-logout {
    background: linear-gradient(135deg, #e53935 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(229, 57, 53, 0.3);
}

#logoutModal .btn-cancel:hover, #logoutModal .btn-logout:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Mobile responsive for all popups */
@media (max-width: 768px) {
    .popup-content, .modal-content, #logoutModal .modal-content {
        width: 95%;
        max-width: 400px;
        margin: 20px;
    }
    
    .popup-header, #logoutModal .modal-header {
        padding: 25px 25px 20px 25px;
    }
    
    .popup-body, #logoutModal .modal-body {
        padding: 25px;
    }
    
    .popup-title, #logoutModal .modal-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .popup-input, .modal input {
        padding: 16px 18px;
    }
    
    .popup-btn, .modal button {
        padding: 16px;
        font-size: 1rem;
    }
    
    .popup-close, .close {
        top: 15px;
        right: 20px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    #logoutModal .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    #logoutModal .btn-cancel, #logoutModal .btn-logout {
        width: 100%;
        padding: 16px;
    }
}
