/* Security Cards - Wide Side-by-Side Layout */

.security-cards-layout {
    display: flex;
    gap: 24px;
    height: 480px;
    align-items: stretch;
    padding: 5px;
    width: 100%;
}

.security-menu {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ... security-card styles ... */
.security-card {
    background: rgba(30, 30, 35, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.security-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.security-card.active {
    background: rgba(155, 93, 229, 0.1);
    border-color: #9b5de5;
    box-shadow: 0 0 20px rgba(155, 93, 229, 0.15);
}

.security-card.danger-card.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.security-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.security-card.active .security-card-icon {
    background: #9b5de5;
    color: white;
    box-shadow: 0 4px 12px rgba(155, 93, 229, 0.4);
}

.security-card.danger-card .security-card-icon {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.security-card.danger-card.active .security-card-icon {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.security-card-content {
    flex: 1;
}

.security-card-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

.security-card.active .security-card-title {
    color: white;
}

.security-card-arrow {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.2s ease;
}

.security-card.active .security-card-arrow {
    color: rgba(255, 255, 255, 0.8);
}

.security-detail-panel {
    flex: 1;
    width: 100%;
    position: relative;
    background: rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 32px;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* ... (skipping scrollbar styles) ... */

.security-detail-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 360px;
    text-align: center;
    display: none;
    padding: 30px;
    background: transparent;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.security-detail-content.active {
    display: block;
}

.security-detail-content.show {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* Staggered Rise Animation for Content Children */
.security-detail-content.show .detail-title {
    animation: staggeredRise 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s backwards;
}

.security-detail-content.show .detail-desc {
    animation: staggeredRise 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s backwards;
}

.security-detail-content.show .security-input,
.security-detail-content.show .input-group {
    animation: staggeredRise 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s backwards;
}

.security-detail-content.show .gradient-btn,
.security-detail-content.show .danger-btn {
    animation: staggeredRise 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.25s backwards;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -0.5px;
}

.detail-title.danger {
    color: #fca5a5;
}

.detail-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    line-height: 1.5;
    text-align: center;
}

.detail-desc.danger {
    color: #fca5a5;
}

.security-input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(155, 93, 229, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.security-input:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(155, 93, 229, 0.7) !important;
    outline: none;
    box-shadow: 0 0 0 4px rgba(155, 93, 229, 0.15) !important;
}

/* Override browser autofill gray background */
.security-input:-webkit-autofill,
.security-input:-webkit-autofill:hover,
.security-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: white !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.security-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset, 0 0 0 4px rgba(155, 93, 229, 0.15) !important;
    border-color: rgba(155, 93, 229, 0.7) !important;
}

.security-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-group.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.verify-code-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.verify-code-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gradient-btn {
    width: 100%;
    background: linear-gradient(135deg, #c084fc, #e879f9);
    border: none;
    border-radius: 16px;
    padding: 16px;
    color: white;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(192, 132, 252, 0.3);
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(192, 132, 252, 0.4);
    filter: brightness(1.1);
}

.gradient-btn:active {
    transform: scale(0.98);
}

.danger-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 16px;
    color: #fca5a5;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fff;
}

@media (max-width: 768px) {

    /* Hide Desktop Layout completely */
    .security-cards-layout {
        display: none !important;
    }

    /* Show Mobile Layout */
    .mobile-security-layout {
        display: block !important;
        padding: 0;
        padding-bottom: 0px;
        /* Removed padding completely */
    }

    /* Hide the large "Security Settings" title on mobile to save space */
    #view-security .modal-title {
        display: none;
    }

    .mobile-security-section {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 16px;
        padding: 16px;
        margin-bottom: 12px;
    }

    .mobile-section-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 12px;
        color: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-section-title::before {
        content: '';
        display: block;
        width: 3px;
        height: 14px;
        background: #9b5de5;
        border-radius: 2px;
    }

    .mobile-section-title.danger::before {
        background: #ff4757;
    }

    .mobile-section-desc {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 12px;
        line-height: 1.4;
    }

    .mobile-security-layout .input-group {
        margin-bottom: 10px;
    }

    .mobile-security-layout .security-input {
        width: 100%;
        background: transparent;
        border: 1px solid rgba(155, 93, 229, 0.3);
        border-radius: 10px;
        padding: 10px 12px;
        color: #fff;
        font-size: 14px !important;
        /* Slightly smaller text */
        transition: all 0.3s ease;
        height: 42px;
        /* Fixed height */
    }

    .mobile-security-layout .security-input:focus {
        border-color: rgba(155, 93, 229, 0.7);
        background: transparent !important;
        outline: none;
        box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.12);
    }

    .mobile-security-layout .code-btn {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        color: #fff;
        padding: 0 12px;
        font-size: 13px;
        white-space: nowrap;
        cursor: pointer;
        height: 42px;
        /* Match input height */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-security-layout .gradient-btn {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
        background: linear-gradient(135deg, #9b5de5, #f15bb5);
        border: none;
        color: #fff;
        font-weight: 600;
        font-size: 14px;
        margin-top: 5px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-security-layout .danger-btn {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
        background: rgba(255, 71, 87, 0.1);
        border: 1px solid rgba(255, 71, 87, 0.3);
        color: #ff4757;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 40px;
    }

    /* Staggered Rise Animation for Mobile Security Sections */
    /* Triggered when parent .profile-back has .animate-in class */
    .profile-back.animate-in .mobile-security-section {
        animation: staggeredRise 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
    }

    .profile-back.animate-in .mobile-security-section:nth-child(1) {
        animation-delay: 0.1s;
    }

    .profile-back.animate-in .mobile-security-section:nth-child(2) {
        animation-delay: 0.2s;
    }

    .profile-back.animate-in .mobile-security-section:nth-child(3) {
        animation-delay: 0.3s;
    }
}

/* Default state: Hide mobile layout on desktop */
.mobile-security-layout {
    display: none;
}